ric.techow has asked for the wisdom of the Perl Monks concerning the following question:
I am reading files from a unix directory and want to copy to another as a backup. problem is that file names with spaces cause this line to fail.
$status = copy ("$groupFile","$errDir");
$groupFile contains a fully qualified file name. $errDir is a directory.
Fine for normal files but not those with spaces. I have seen examples where a known file name can have any spaces escaped. But I don't know what these files are (and don't care).
Do I need to check for spaces and change every space in $groupfile to '\ '? Is there a better way??
( using File::Copy;)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: how to copy files with spaces in name
by rovf (Priest) on Mar 06, 2009 at 10:03 UTC | |
Re: how to copy files with spaces in name
by shmem (Chancellor) on Mar 06, 2009 at 10:03 UTC | |
by ric.techow (Initiate) on Mar 06, 2009 at 12:41 UTC | |
by shmem (Chancellor) on Mar 06, 2009 at 13:06 UTC | |
Re: how to copy files with spaces in name
by Anonymous Monk on Mar 06, 2009 at 10:15 UTC |
Back to
Seekers of Perl Wisdom