-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
41 lines (37 loc) · 1.39 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
31
32
33
34
35
36
37
38
39
40
41
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: srheede <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/06/14 07:33:01 by srheede #+# #+# */
/* Updated: 2018/06/14 07:33:41 by srheede ### ########.fr */
/* */
/* ************************************************************************** */
#include "get_next_line.h"
int main(void)
{
int fd1;
int fd2;
char *line;
fd1 = open("file", O_RDONLY);
fd2 = open("file2", O_RDONLY);
line = ft_strnew(50);
while (get_next_line(fd2, &line) == 1)
{
ft_putstr("mine: ");
ft_putendl(line);
get_next_line(fd1, &line);
ft_putendl(line);
}
close(fd1);
close(fd2);
fd1 = open("file", O_RDONLY);
while (get_next_line_theirs(fd1, &line) == 1)
{
ft_putstr("theirs: ");
ft_putendl(line);
}
close(fd1);
}