From 2ec30275321d52f89b8f9fb1ed1668edeeab694b Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 3 Jun 2021 16:20:36 +0200 Subject: ignore folders working --- musicopy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/musicopy.c b/musicopy.c index 3a85331..80ed706 100644 --- a/musicopy.c +++ b/musicopy.c @@ -104,6 +104,8 @@ void copy(const char* path) { } int dir_callback(const char* path, const struct stat *sb, int tflag) { + if(tflag != FTW_F) return 0; + if (include_length > 0) { bool includes = false; for(int i = 0; i < include_length; i++) { @@ -155,7 +157,7 @@ int main() { print_opts(); - ftw(music_dir, dir_callback, FTW_F); + ftw(music_dir, dir_callback, 0); return 0; } -- cgit v1.2.3