projects
/
finddup.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d2131aa
)
Prints the number of files when scanning is done.
author
Francois Fleuret
<francois@fleuret.org>
Tue, 23 Mar 2010 21:27:24 +0000
(22:27 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Tue, 23 Mar 2010 21:27:24 +0000
(22:27 +0100)
finddup.c
patch
|
blob
|
history
diff --git
a/finddup.c
b/finddup.c
index
87ae90e
..
197b82e
100644
(file)
--- a/
finddup.c
+++ b/
finddup.c
@@
-412,7
+412,7
@@
void start(const char *dirname1, const char *dirname2) {
struct file_node *node1, *node2;
int not_in, found;
int nb_groups, nb_nodes;
struct file_node *node1, *node2;
int not_in, found;
int nb_groups, nb_nodes;
- int list1_length, previous_progress;
+ int list1_length,
list2_length,
previous_progress;
char *buffer1 = safe_malloc(sizeof(char) * READ_BUFFER_SIZE);
char *buffer2 = safe_malloc(sizeof(char) * READ_BUFFER_SIZE);
char *buffer1 = safe_malloc(sizeof(char) * READ_BUFFER_SIZE);
char *buffer2 = safe_malloc(sizeof(char) * READ_BUFFER_SIZE);
@@
-425,6
+425,8
@@
void start(const char *dirname1, const char *dirname2) {
list1 = scan_directory(0, dirname1);
list1 = scan_directory(0, dirname1);
+ list1_length = file_list_length(list1);
+
if(dirname2) {
if(strncmp(dirname2, "not:", 4) == 0) {
not_in = 1;
if(dirname2) {
if(strncmp(dirname2, "not:", 4) == 0) {
not_in = 1;
@@
-444,12
+446,21
@@
void start(const char *dirname1, const char *dirname2) {
if(show_progress) {
fprintf(stderr, "done.\n");
if(show_progress) {
fprintf(stderr, "done.\n");
+ fprintf(stderr,
+ "%s: %d file%s.\n",
+ dirname1, list1_length, (list1_length > 1 ? "s" : ""));
+ if(dirname2) {
+ list2_length = file_list_length(list2);
+ fprintf(stderr,
+ "%s: %d file%s.\n",
+ dirname2, list2_length, (list2_length > 1 ? "s" : ""));
+ }
+ fprintf(stderr, "Now looking for identical files.\n");
}
nb_groups = 0;
previous_progress = -1;
nb_nodes = 0;
}
nb_groups = 0;
previous_progress = -1;
nb_nodes = 0;
- list1_length = file_list_length(list1);
if(not_in) {
for(node1 = list1; node1; node1 = node1->next) {
if(not_in) {
for(node1 = list1; node1; node1 = node1->next) {