This repository has been archived on 2023-12-28. You can view files and clone it, but cannot push or open issues or pull requests.
c_piscine_rush_02/ex00/ft_open.c

28 lines
1.1 KiB
C
Raw Normal View History

2023-12-03 15:11:58 +00:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_open.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: asargsya <asargsya@student.42yerevan.am> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/03 19:08:11 by asargsya #+# #+# */
2023-12-03 16:18:10 +00:00
/* Updated: 2023/12/03 20:17:25 by achubuko ### ########.fr */
2023-12-03 15:11:58 +00:00
/* */
/* ************************************************************************** */
2023-12-03 16:18:10 +00:00
#include "ft_open.h"
2023-12-03 15:11:58 +00:00
2023-12-03 16:18:10 +00:00
void ft_dict_open(char *path)
2023-12-03 15:11:58 +00:00
{
int fd;
char buf[1024];
int buflen;
2023-12-03 16:18:10 +00:00
fd = open(path, O_RDONLY);
buflen = read(fd, buf, 1024);
while (buflen > 0)
2023-12-03 15:11:58 +00:00
{
write(1, buf, buflen);
}
close(fd);
}