From 84dab7c4d6c34e8d2111d434aab489db84ed3fbf Mon Sep 17 00:00:00 2001 From: Thorsten Töpper Date: Thu, 19 Feb 2026 22:27:38 +0100 Subject: duplicate_finder: Not working --- src/duplicate_finder.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src/duplicate_finder.c') diff --git a/src/duplicate_finder.c b/src/duplicate_finder.c index bd679e9..714fd96 100644 --- a/src/duplicate_finder.c +++ b/src/duplicate_finder.c @@ -21,7 +21,7 @@ #include "options.h" #include "kv_manager.h" #include "directory_scanner.h" - +#include "database_interaction.h" /*=========== DEFINES, CONSTANTS AND TYPES ===========*/ @@ -36,13 +36,28 @@ int main(int argc, char **argv) { path_index = parse_arguments(argc, argv); } - /* TODO: as option */ - kv_open_storage("/tmp/duplicate_finder.gdbm"); - process_directory((path_index == argc) ? argv[path_index] : "."); + /* TODO: name as option */ + if ( ! kv_open_storage("/tmp/duplicate_finder.gdbm") ) { + return EXIT_FAILURE; + } + + /* TODO: name as option */ + dbi_open("/tmp/duplicate_finder.sqlite"); + traverse_directory_tree((path_index == argc) ? argv[path_index] : "."); + +#ifdef DEBUGBUILD + kv_dump(stdout); +#endif + + process_gdbm_content(); +#ifdef DEBUGBUILD kv_dump(stdout); +#endif + /* TODO: Implement signal handlers and add the close for sqlite and gdbm dbs there */ kv_close_storage(); + dbi_close(); return EXIT_SUCCESS; } -- cgit v1.3