aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_check_not_found.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-02-19 17:42:39 +0100
committerRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-02-19 17:42:39 +0100
commit7b2b82106491c78e7a288a77db1f5080ef089d0f (patch)
tree493a98bc97be86c4aaf34dbe0d29730e855a725b /src/ft_check_not_found.c
parentCommit (diff)
download42-cub3d-7b2b82106491c78e7a288a77db1f5080ef089d0f.tar.gz
42-cub3d-7b2b82106491c78e7a288a77db1f5080ef089d0f.tar.bz2
42-cub3d-7b2b82106491c78e7a288a77db1f5080ef089d0f.tar.xz
42-cub3d-7b2b82106491c78e7a288a77db1f5080ef089d0f.tar.zst
42-cub3d-7b2b82106491c78e7a288a77db1f5080ef089d0f.zip
go merge
Diffstat (limited to 'src/ft_check_not_found.c')
-rw-r--r--src/ft_check_not_found.c15
1 files changed, 15 insertions, 0 deletions
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 <cub3d.h>
+#include <stdint.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+int8_t
+ ft_check_not_found(const char *path)
+{
+ int fd;
+
+ if ((fd = open(path, O_RDONLY)) < 0)
+ return (-1);
+ close(fd);
+ return (0);
+}