From 7b2b82106491c78e7a288a77db1f5080ef089d0f Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Wed, 19 Feb 2020 17:42:39 +0100 Subject: go merge --- src/ft_check_not_found.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/ft_check_not_found.c (limited to 'src/ft_check_not_found.c') diff --git a/src/ft_check_not_found.c b/src/ft_check_not_found.c new file mode 100644 index 0000000..9233846 --- /dev/null +++ b/src/ft_check_not_found.c @@ -0,0 +1,15 @@ +#include +#include +#include +#include + +int8_t + ft_check_not_found(const char *path) +{ + int fd; + + if ((fd = open(path, O_RDONLY)) < 0) + return (-1); + close(fd); + return (0); +} -- cgit v1.2.3