From cde037271602b63fe8cd483adc178ebb98643826 Mon Sep 17 00:00:00 2001 From: Aleksei Chubukov Date: Sun, 3 Dec 2023 20:18:10 +0400 Subject: [PATCH] add ft_dict_open --- ex00/ft_open.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ex00/ft_open.c b/ex00/ft_open.c index 0cd3f3e..ade2bb7 100644 --- a/ex00/ft_open.c +++ b/ex00/ft_open.c @@ -6,20 +6,20 @@ /* By: asargsya +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/12/03 19:08:11 by asargsya #+# #+# */ -/* Updated: 2023/12/03 19:11:31 by asargsya ### ########.fr */ +/* Updated: 2023/12/03 20:17:25 by achubuko ### ########.fr */ /* */ /* ************************************************************************** */ +#include "ft_open.h" -#include - -void ft_open(char *path) +void ft_dict_open(char *path) { int fd; char buf[1024]; int buflen; - fd = open(&path, O_RDONLY); - while ((buflen == read(fd, buf, 1024)) > 0) + fd = open(path, O_RDONLY); + buflen = read(fd, buf, 1024); + while (buflen > 0) { write(1, buf, buflen); }