in reply to using File::Copy move() in Windows directories containing parentheses

Hi,

glob likes forward slashes too

OTOH Path::Tiny uses File::Copy, its convenient

#!/usr/bin/perl -- use Path::Tiny; my $src = 'C:/temp (1)J'; my $dst = 'C:/out/'; for my $file ( path( $src )->children ){ if( $file->copy( $dst ) ){ $file->remove; } } __END__ $ tree -f -a "temp (1)J" out temp (1)J |-- temp (1)J/1 `-- temp (1)J/2 out 0 directories, 2 files $ perl mytask.pl $ tree -f -a "temp (1)J" out temp (1)J out |-- out/1 `-- out/2 0 directories, 2 files
  • Comment on Re: using File::Copy move() in Windows directories containing parentheses (Path::Tiny)
  • Download Code

Replies are listed 'Best First'.
Re^2: using File::Copy move() in Windows directories containing parentheses (Path::Tiny)
by ruqui (Acolyte) on Feb 04, 2017 at 13:09 UTC
    using Path::Tiny really helped a lot (with globs I had problems also when the destination folder contains spaces, with Path::Tiny all problems are gone) Thanks!