29 lines
1.1 KiB
C
29 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_io.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/04/01 08:51:59 by tischmid #+# #+# */
|
|
/* Updated: 2023/04/01 18:03:28 by tischmid ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "ft_io.h"
|
|
#include <stdio.h>
|
|
#include <fcntl.h>
|
|
#include <unistd.h>
|
|
|
|
int file_readable(char *path)
|
|
{
|
|
int fd;
|
|
|
|
fd = open(path, O_RDONLY, 0);
|
|
if (fd < 0)
|
|
return (0);
|
|
if (close(fd) < 0)
|
|
return (0);
|
|
return (1);
|
|
}
|