From 951ba68794bc228e00c40d36cca44c65da69603c Mon Sep 17 00:00:00 2001 From: Thorsten Töpper Date: Sun, 1 Mar 2026 19:30:09 +0100 Subject: Be more verbose when scanning. --- .gitignore | 2 ++ src/directory_scanner.c | 3 +++ src/file_processor.c | 5 +++++ src/options.c | 1 + 4 files changed, 11 insertions(+) diff --git a/.gitignore b/.gitignore index c82077c..8e7a610 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ bin/* man/*.1 man/*.gz .gdbinit +*.sqlite +*.gdbm diff --git a/src/directory_scanner.c b/src/directory_scanner.c index 0ae1e31..0f2d64c 100644 --- a/src/directory_scanner.c +++ b/src/directory_scanner.c @@ -101,6 +101,9 @@ int traverse_directory_tree(const char *starting_point) { /* In case there are still entries on an existing pstack, take them with you */ while (tmp != NULL) { + if (! option_quiet) { + LOGERR("Read directory %s\n", tmp); + } DBGTRC("DEBUG: process directory %s next\n", tmp); rc = process_directory(tmp); if (rc < 0) { return -1; } diff --git a/src/file_processor.c b/src/file_processor.c index da51e30..b2b4f85 100644 --- a/src/file_processor.c +++ b/src/file_processor.c @@ -24,6 +24,7 @@ #include "hex_conversion.h" #include "kv_manager.h" #include "database_interaction.h" +#include "options.h" /*=========== DEFINES, CONSTANTS AND TYPES ===========*/ @@ -229,6 +230,10 @@ int process_file(struct df_fileinfo *info) { return -1; } + if ( ! option_quiet ) { + LOGERR("Calculating hashes for file '%s'\n", fullpath); + } + /* TODO: proper fread related error handling */ while (true) { bytes_read = fread(buffer, sizeof(unsigned char), glbl_bufsize, fdin); diff --git a/src/options.c b/src/options.c index 7bcd9b0..0b55df1 100644 --- a/src/options.c +++ b/src/options.c @@ -59,6 +59,7 @@ void usage(char *executable) { fprintf(stderr, " %-10s %-10s %s\n", "analyze", "", "Currently no parameter"); fprintf(stderr, " %-10s %-10s %s\n", "dump", "fullpath", "Print the full stored path of each files entry"); fprintf(stderr, " %-10s %-10s %s\n", "", "fileinfos", "Print all entries combined with hashes"); + fprintf(stderr, " %-10s %-10s %s\n", "", "filenames", "Print all filenames (without path)"); fprintf(stderr, " %-10s %-10s %s\n", "scan", "", "path in the FS below which files should be scanned"); } -- cgit v1.3