/* ************************************************************************** */ /* LE - / */ /* / */ /* ft_history.c .:: .:/ . .:: */ /* +:+:+ +: +: +:+:+ */ /* By: rbousset +:+ +: +: +:+ */ /* #+# #+ #+ #+# */ /* Created: 2019/10/30 20:36:05 by rbousset #+# ## ## #+# */ /* Updated: 2019/10/30 20:36:07 by rbousset ### #+. /#+ ###.fr */ /* / */ /* / */ /* ************************************************************************** */ #include #include #include #include #include #include int ft_history(char *arg) { char c; int fd; int r; if ((fd = open("joe-sh_history", O_CREAT | O_RDWR, 0644)) == -1) return (1); while ((r = read(fd, &c, 1)) != EOF) puts(&c); ft_putendl_fd(arg, fd); close(fd); return (0); }