fix trash-put failing on space in filename
This commit is contained in:
parent
e1f0631751
commit
0c2f45e2f2
|
@ -7,16 +7,16 @@ use File::Path("make_path");
|
|||
use List::Util("max");
|
||||
|
||||
sub fs_root ($file_name) {
|
||||
chomp( my $ret = `stat -c %m $file_name` );
|
||||
chomp( my $ret = `stat -c %m "$file_name"` );
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub file_info ($file) {
|
||||
my $file_name = `basename $file`;
|
||||
my $file_path = `realpath -s $file`;
|
||||
my $file_name = `basename "$file"`;
|
||||
my $file_path = `realpath -s "$file"`;
|
||||
chomp( $file_name, $file_path );
|
||||
my $file_fs_root = fs_root($file_name);
|
||||
|
||||
chomp( $file_name, $file_path, $file_fs_root );
|
||||
return ( $file_name, $file_path, $file_fs_root );
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,7 @@ if ( $#ARGV + 1 != 1 ) {
|
|||
|
||||
stat $ARGV[0] or die "$!\n";
|
||||
my ( $file_name, $file_src, $file_fs_root ) = file_info( $ARGV[0] );
|
||||
|
||||
my ( $trash_info_path, $trash_file_path ) = trash_dirs($file_fs_root);
|
||||
my $target_name = target_file_name( $file_name, $trash_file_path );
|
||||
chomp( my $deletion_time = `date -u +%Y%m%dUTC%T` );
|
||||
|
|
Loading…
Reference in New Issue