trash script bugfix
This commit is contained in:
parent
c7191d69f6
commit
5cf5a09bed
|
@ -37,7 +37,7 @@ sub trash_dirs ($file_fs_root) {
|
|||
sub target_file_name ( $file_name, $trash_file_path ) {
|
||||
opendir( my $dir, "$trash_file_path" ) or die "$!";
|
||||
my $existing_suffix_nums =
|
||||
map( ( $_ =~ /^${file_name}\.~(\d)~/ ), readdir $dir );
|
||||
map( ( $_ =~ /^${file_name}\.~(\d+)~/ ), readdir $dir );
|
||||
my $suffix_num = max($existing_suffix_nums) + 1;
|
||||
my $suffix = "~" . $suffix_num . "~";
|
||||
closedir($dir);
|
||||
|
|
|
@ -22,7 +22,7 @@ sub trashed_files ( $search_path, $trash_path ) {
|
|||
my @ret;
|
||||
opendir( my $dir, "$trash_path/info" ) or die "$!\n";
|
||||
for ( readdir $dir ) {
|
||||
$_ =~ /\.~\d~$/ or next;
|
||||
$_ =~ /\.~\d+~$/ or next;
|
||||
open( FH, "<", "$trash_path/info/$_" ) or next;
|
||||
<FH> eq "[Trash Info]\n" or next;
|
||||
my ( $name, $path, $suffix ) =
|
||||
|
|
Loading…
Reference in New Issue