W. Chris Shank on Fri, 21 Jun 2002 11:44:05 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] OT - Perl Question


I am trying to call the following windows system command (copy)

sub backup {
	@args = ("copy", $_[0], $_[1]);
	system(@args) == 0
     		or die "backup system @args failed: $?";
}

called like: backup("$file1", "$file2"); #copy file1 to file2 
but the files include the path relative to where the perl script chdir's,
and there is an upper level folder that has spaces in it. so the files would
look like: .\\Folder Name with Spaces\file1.ext & .\\Folder Name with
Space\file2.ext

here is the failure: 
The system cannot find the file specified. 

and then lists the above path\file. i tried to escape the blank with a
backslash{blank} butit doesn't help. It seems to be a windows problem since
perl can traverse the folders ok.

any help with explaination is appreciated.


thanks


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug