Skip to content
Snippets Groups Projects
Commit 80a55b8b authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

show and count deleted records

parent 91abb28f
No related branches found
No related tags found
No related merge requests found
...@@ -98,7 +98,7 @@ sub scan_dir ...@@ -98,7 +98,7 @@ sub scan_dir
} }
my @res= (); my @res= ();
my ($cnt_added, $cnt_updated, $cnt_unchanged)= (0, 0, 0); my ($cnt_added, $cnt_updated, $cnt_unchanged, $cnt_dropped)= (0, 0, 0, 0);
NOTE: while (my $e= readdir (DIR)) NOTE: while (my $e= readdir (DIR))
{ {
next NOTE if ($e eq '.' || $e eq '..'); next NOTE if ($e eq '.' || $e eq '..');
...@@ -117,6 +117,7 @@ sub scan_dir ...@@ -117,6 +117,7 @@ sub scan_dir
if ($quick) if ($quick)
{ {
my $x_rec= $fnm{$fp}; my $x_rec= $fnm{$fp};
delete ($fnm{$fp});
if (defined ($x_rec)) if (defined ($x_rec))
{ {
...@@ -165,9 +166,15 @@ sub scan_dir ...@@ -165,9 +166,15 @@ sub scan_dir
closedir (DIR); closedir (DIR);
# TODO: list dropped files # TODO: list dropped files
foreach my $fp (keys %fnm)
{
print "dropped: ", $fp, "\n";
$cnt_dropped++;
}
# TODO: save statistics and/or file status for later processing # TODO: save statistics and/or file status for later processing
print "statistics: cnt_added=$cnt_added cnt_updated=$cnt_updated cnt_unchanged=$cnt_unchanged\n"; print "statistics: cnt_added=$cnt_added cnt_updated=$cnt_updated cnt_dropped=$cnt_dropped cnt_unchanged=$cnt_unchanged\n";
(wantarray) ? @res : \@res; (wantarray) ? @res : \@res;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment