void my_opt_R(t_my_file *files, char *opt) { t_my_file *tmp; tmp = files; while (tmp != NULL) { if ((opt[ALL] && !my_check_dir(tmp->name) || tmp->name[0] != '.') && tmp->type == DT_DIR) { my_printf("\n"); my_read_dir(my_pathfile(tmp->path, tmp->name, '/'), opt, 0, 1); } tmp = tmp->next; } free(tmp); }
/* ** This function looks like a main, but i'm not sure I pasted it... <3 */ int my_ls(char **argv, int fd, char *ignored) { int i; char opt[8]; errno = 0; i = 0; (void)argv; (void)ignored; my_printf(fd, "150 Opening ASCII mode data connection for file list\n"); g_fd = fd; while (i < 8) opt[i++] = 0; (void)my_read_dir("./", opt, 0, 1); my_printf(fd, "226 Transfer complete\n"); my_printf(fd, "%s\n", END_READ); free_wordtab(argv); return (0); }