App-Hashl

 view release on metacpan or  search on metacpan

bin/hashl  view on Meta::CPAN

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
my $add_unignore  = 0;
my $base          = getcwd();
my $rel_paths     = 1;
my $db_file       = '.hashl.db';
my $total         = 0;
my $cur           = 0;
my $show_progress = 1;
my $xdev_fsno;
my @edb_files;
my $timer;
my $incoming_dir;
my $read_size;
my ( $find_ref, $find_db_write );
 
my $hashl;
my @ehashl;
 
our $VERSION = '1.01';
 
STDERR->autoflush(1);

bin/hashl  view on Meta::CPAN

199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
        return;
}
 
if ($rel_paths) {
        $file = substr( $file, length($base) + 1 );
}
 
$cur++;
 
if ($show_progress) {
        print STDERR $timer->report(
                "\r\e[2KScanning directory: %p done, %L elapsed, %E remaining",
                $cur, );
}
 
&{$code}( $file, $path );
 
if ( $write and ( ( $cur % 5000 ) == 0 ) ) {
        $hashl->save($db_file);
}

bin/hashl  view on Meta::CPAN

268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
        my ($dir) = @_;
 
        $dir //= $base;
 
        if ( not $show_progress ) {
                return;
        }
 
        find( \&get_total, $dir );
 
        $timer = Time::Progress->new();
        $timer->attr(
                min => 1,
                max => $total,
        );
 
        return;
}
 
sub cmd_copy {
        ($incoming_dir) = @_;



( run in 0.383 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )