int my_ls_only(char **av, int nb_path, int i) { DIR *dir; char *name; char **tab; struct dirent *current; name = check_no_option(av, nb_path); dir = opendir(name); if ((tab = malloc(sizeof(char))) == NULL) exit(EXIT_FAILURE); while ((current = readdir(dir)) != NULL) { if (current->d_name[0] != '.') { if ((tab[i] = malloc(sizeof(tab[i]) * 100)) == NULL) exit(EXIT_FAILURE); tab[i] = current->d_name; i = i + 1; } } print_tab(tab); closedir(dir); return (0); }