#include #include #include #include #include int main() { DIR * dir = opendir("."); if (dir == NULL) { fprintf(stderr, "Can't open \".\"\n"); exit(1); } while (1) { struct dirent * entry = readdir(dir); if (entry == NULL) break; if (entry->d_type == DT_DIR) continue; printf("File \"%s\" (d or k)? ", entry->d_name); char response[100]; scanf("%s", response); if (response[0] == 'd') unlink(entry->d_name); } closedir(dir); }