add ft_dict_open
This commit is contained in:
parent
88f211326a
commit
cde0372716
@ -6,20 +6,20 @@
|
|||||||
/* By: asargsya <asargsya@student.42yerevan.am> +#+ +:+ +#+ */
|
/* By: asargsya <asargsya@student.42yerevan.am> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/12/03 19:08:11 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 <unistd.h>
|
void ft_dict_open(char *path)
|
||||||
|
|
||||||
void ft_open(char *path)
|
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
int buflen;
|
int buflen;
|
||||||
|
|
||||||
fd = open(&path, O_RDONLY);
|
fd = open(path, O_RDONLY);
|
||||||
while ((buflen == read(fd, buf, 1024)) > 0)
|
buflen = read(fd, buf, 1024);
|
||||||
|
while (buflen > 0)
|
||||||
{
|
{
|
||||||
write(1, buf, buflen);
|
write(1, buf, buflen);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user