aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/copy_file.c4
-rw-r--r--libbb/make_directory.c4
-rw-r--r--libbb/remove_file.c8
3 files changed, 16 insertions, 0 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index 9333a8d49..a4be875d2 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -389,5 +389,9 @@ int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
bb_perror_msg("can't preserve %s of '%s'", "permissions", dest);
}
+ if (flags & FILEUTILS_VERBOSE) {
+ printf("'%s' -> '%s'\n", source, dest);
+ }
+
return retval;
}
diff --git a/libbb/make_directory.c b/libbb/make_directory.c
index 7826b90f5..89352ca1f 100644
--- a/libbb/make_directory.c
+++ b/libbb/make_directory.c
@@ -99,6 +99,10 @@ int FAST_FUNC bb_make_directory(char *path, long mode, int flags)
if (!c) {
goto ret0;
}
+ } else {
+ if (flags & FILEUTILS_VERBOSE) {
+ printf("created directory: '%s'\n", path);
+ }
}
if (!c) {
diff --git a/libbb/remove_file.c b/libbb/remove_file.c
index 5b75f7f30..eaca293d9 100644
--- a/libbb/remove_file.c
+++ b/libbb/remove_file.c
@@ -78,6 +78,10 @@ int FAST_FUNC remove_file(const char *path, int flags)
return -1;
}
+ if (flags & FILEUTILS_VERBOSE) {
+ printf("removed directory: '%s'\n", path);
+ }
+
return status;
}
@@ -98,5 +102,9 @@ int FAST_FUNC remove_file(const char *path, int flags)
return -1;
}
+ if (flags & FILEUTILS_VERBOSE) {
+ printf("removed '%s'\n", path);
+ }
+
return 0;
}