I was attempting to copy a directory on windows with the dircopy subroutine of module File::Copy::Recursive. However whenever I run the program it claims the directory does not exist. For my code:
} else { print "\nAll songs found matches! ^_^ \n";} print "Copying Files....\n\n"; print "0% 100%\n"; my $div; {use integer; $div=(scalar keys %moves) / 25 + 1 ;} my $i = 0; foreach $dir (keys %moves) { unless (defined $opt{s}) {dircopy("$dir","$moves{$dir}") or die("\ +n!: Couldnt copy \"$dir\" : $!\n");} print "." if (($i % $div) == 0); $i++; }
All songs found matches! ^_^ Copying Files.... 0% 100% !: Couldnt copy "C:\Program Files\Stepmania CVS\Songs\Dance Dance Revo +lution 5th Mix\Abyss" : No such file or directory
%moves is generated dynamicly so I thought I might have messed up the generation routine. To check I added the lines:
... unless (defined $opt{s}) { print "it exists\n" if (-e $dir); #here print "its a dir\n" if (-d $dir); #and here dircopy("$dir","$moves{$dir}") or die("\n!: Couldnt copy \"$di +r\" : $!\n"); ...
... All songs found matches! ^_^ Copying Files.... 0% 100% it exists its a dir !: Couldnt copy "C:\Program Files\Stepmania CVS\Songs\Dance Dance Revo +lution 5th Mix\Abyss" : No such file or directory
What am I doing wrong? If the fault is with the module being none m$ compatible what should I use in its place?
Thanks In Advance, ~Phoenix9Janitored by Arunbear - replaced pre tags with code tags, to prevent distortion of site layout.
In reply to SOLVED:Copy a directory on windows by phoenix9
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |