Ok, I was wrong, the folder is created in the Destination dir, but it
is empty, and my perl code gives an error in the die statement...

Uncaught exception from user code:
        Error: Permission denied

What am I doing wrong here?

>>> Is there a Perl way to move a folder with out doing it one file at
>>> a time? (Similar to M$ Windows Explorer where you can drag a folder
>>> to another folder?)

BWM>> Of course -- take a look at the File::Copy module. It has a move
BWM>> function in it.

TM> Isn't File::Copy for Files? I need to move Directories. For example a
TM> WinNT directory that has been copied to a network drive for backup.

TM> Here is my code for testing File::Copy (both the move and copy).  Am I
TM> doing something wrong?

TM> #!perl -w
TM> use strict;
TM> use diagnostics;
TM> use File::Copy;

TM> my $Drv = "D:";
TM> my $SourceFolder = "!Source";
TM> my $DestFolder =   "!Dest";
TM> my $TestFolder = "test";
TM> my $Source = "$Drv/$SourceFolder/$TestFolder";
TM> my $Dest = "$Drv/$DestFolder/$TestFolder";
TM> #my $Dest = "$Drv/$DestFolder";

TM> # Set up the test folders
TM> if (!-d $Dest) { mkdir($Dest); } # Create the Destination dir
TM> if (!-d "$Drv/$Source") { # Create the Source dirs
TM>   mkdir("$Drv/$SourceFolder");
TM>   if (!-d $Source) { mkdir($Source); }
TM> }

TM> # =========== The Test Code ============
TM> if ( -d $Source ) {
TM>     print "\nSource\t$Source\n";
TM> print "Dest\t$Dest\n";
TM>     move ($Source, $Dest) or die "Error: $!\n";
TM>     if ( -d "$Dest/$TestFolder" ) {
TM>         print "Dest\t$Dest\n";
TM>     }
TM> }




-- 
[EMAIL PROTECTED]
Using The Bat! eMail v1.53d
Windows NT 5.0.2195 (Service Pack 1)
What goes around usually gets dizzy and falls over.

Reply via email to