aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_check_not_found.c
blob: 1f5f4abf93dd6969ff7a0a85f3d06ef9c7b9ec43 (plain)
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
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_check_not_found.c                               :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: joelecle <marvin@42.fr>                    +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/02/19 19:26:27 by joelecle          #+#    #+#             */
/*   Updated: 2020/02/19 19:26:28 by joelecle         ###   ########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);
}