From: Zygo Blaxell Date: Sat, 9 Jan 2010 04:20:06 +0000 (-0500) Subject: Add file sizes to --progress output, once per second X-Git-Tag: dm6-0.20100514~15 X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=dupemerge;a=commitdiff_plain;h=3006d33478ecfc36d7e311028dab4bdb2975c052 Add file sizes to --progress output, once per second --- diff --git a/faster-dupemerge b/faster-dupemerge index bc3a5af..683ed32 100755 --- a/faster-dupemerge +++ b/faster-dupemerge @@ -587,6 +587,8 @@ end_merge: undef %inode_to_file_name; } +my $last_time = 0; + while () { my ($weak_key, $size, $dev, $ino, $name) = m/^((\d+) \d+ \d+ \d+ -?[\d.]+) (\d+) (\d+) (.+)\0$/so; die "read error: $!\nLast input line was '$_'" unless defined($name); @@ -603,6 +605,14 @@ while () { $skip_compares = $skip_compare_preference; } + if ($progress) { + my $this_time = time(); + if ($this_time != $last_time) { + $last_time = $this_time; + print STDERR "($size)"; + } + } + $input_links++; merge_files if $weak_key ne $current_key; $current_key = $weak_key;