summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorAbdellah El Morabit <nsrddyn@gmail.com>2025-02-25 18:24:31 +0100
committerAbdellah El Morabit <nsrddyn@gmail.com>2025-02-25 18:24:31 +0100
commiteafff8845db6c81384beee5d72ac30a4c9cd1972 (patch)
tree98993e440a79091035d7bfb0d2cd8a2b6de64b9b /main.c
parente20e3f22e9218dc99cf7609687051669b9c445ae (diff)
made the readme file
Diffstat (limited to 'main.c')
-rw-r--r--main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.c b/main.c
index ccd2a73..d8accff 100644
--- a/main.c
+++ b/main.c
@@ -159,7 +159,9 @@ void remove_dir(const char *path) {
if (dP == NULL) {
perror("failed to open the directory to delete the files recursively");
+
}
+ else {
while ((entry = readdir(dP)) != NULL && rmdir(path) != 0){
if (strcmp(entry->d_name, "." ) == 0 || strcmp(entry->d_name, "..")== 0){
@@ -169,6 +171,7 @@ void remove_dir(const char *path) {
else if (remove(entry->d_name) != 0) {
printf("%p", entry->d_name);
perror("failed to delete the directory 02");
+ }
}
}
printf("%p", dP);