From eafff8845db6c81384beee5d72ac30a4c9cd1972 Mon Sep 17 00:00:00 2001 From: Abdellah El Morabit Date: Tue, 25 Feb 2025 18:24:31 +0100 Subject: made the readme file --- main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'main.c') 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); -- cgit v1.2.3-70-g09d2