phoenix9 has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Copy a directory on windows
by poj (Abbot) on Aug 13, 2005 at 13:27 UTC | |
by phoenix9 (Novice) on Aug 13, 2005 at 13:30 UTC | |
by phoenix9 (Novice) on Aug 14, 2005 at 21:26 UTC | |
|
Re: Copy a directory on windows
by Joost (Canon) on Aug 13, 2005 at 08:47 UTC | |
|
Re: Copy a directory on windows
by ambrus (Abbot) on Aug 13, 2005 at 10:04 UTC | |
by phoenix9 (Novice) on Aug 13, 2005 at 13:29 UTC |