-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
30 lines (27 loc) · 1.15 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rabduras <rabduras@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/29 14:54:38 by rabduras #+# #+# */
/* Updated: 2019/11/29 15:05:16 by rabduras ### ########.fr */
/* */
/* ************************************************************************** */
#include "get_next_line.h"
#include <stdio.h>
#include <fcntl.h>
int main(int ac, char **av)
{
char *line;
int fd;
if (ac == 2)
{
fd = open(av[1], O_RDONLY);
line = NULL;
while (get_next_line(fd, &line) > 0)
ft_putendl(line);
}
return (0);
}