summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/main.c b/main.c
index 63b1e3d..da3d895 100644
--- a/main.c
+++ b/main.c
@@ -149,9 +149,17 @@ void remove_dir(const char *path)
struct dirent *entry;
DIR *dP = opendir(path);
- if (dP == NULL){
- perror("failed to open the directory to delete the files recursivly");
+ if (dP == NULL) {
+ perror("failed to open the directory to delete the files recursively");
}
+
+ // ReSharper disable once CppPointerConversionDropsQualifiers
+ while ((entry = readdir(dP)) != NULL) {
+ if (rmdir(entry->d_name) != 0) {
+ perror("failed to delete the directory 02");
+ }
+ }
+ printf("%p", dP);
}
}