aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_check_not_found.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_check_not_found.c')
-rw-r--r--src/ft_check_not_found.c27
1 files changed, 27 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..25afe1a
--- /dev/null
+++ b/src/ft_check_not_found.c
@@ -0,0 +1,27 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_check_not_found.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/19 19:26:27 by rbousset #+# #+# */
+/* Updated: 2020/02/19 19:26:28 by rbousset ### ########lyon.fr */
+/* */
+/* ************************************************************************** */
+
+#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);
+}