App-Hashl
view release on metacpan or search on metacpan
202122232425262728293031323334353637383940my
$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);
199200201202203204205206207208209210211212213214215216217218
return
;
}
if
(
$rel_paths
) {
$file
=
substr
(
$file
,
length
(
$base
) + 1 );
}
$cur
++;
if
(
$show_progress
) {
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
);
}
268269270271272273274275276277278279280281282283284285286287288
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 )