Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: using File::Copy move() in Windows directories containing parentheses (Path::Tiny)

by beech (Parson)
on Feb 04, 2017 at 07:52 UTC ( [id://1181053]=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1181053]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-24 07:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found