/
ft_openfile.c
25 lines (22 loc) · 1.01 KB
/
ft_openfile.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_openfile.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jgaillar <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/09 11:50:21 by jgaillar #+# #+# */
/* Updated: 2017/01/18 20:56:59 by mghazari ### ########.fr */
/* */
/* ************************************************************************** */
#include "fillit.h"
int ft_openfile(char *file)
{
int fd;
fd = (open(file, O_RDONLY));
if (fd < 0)
{
return (-1);
}
return (fd);
}