Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void parse_instructions(int fd)
- {
- char *str;
- int ret;
- ft_putnbr(fd);
- while ((ret = get_next_line(fd, &str)))
- {
- ft_putendl(str);
- free(str);
- }
- }
- int main(int ac, char **av)
- {
- int fd;
- if (ac > 2)
- {
- if (ft_strcmp(av[1], "file") == 0)
- {
- if ((fd = open(av[2], O_RDONLY) != -1))
- {
- ft_putendl(av[2]);
- parse_instructions(fd);
- }
- else
- {
- close(fd);
- ft_putendl("Bad file");
- }
- }
- }
- return (1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement