The major thing to remember when porting xcopy statements to NT4 is that the
/y switch doesn't work with NT4.  As for the subdirectories,  this might
give you a start.  It's some code I wrote when I was first figuring out how
to recurse through subdirectories.  It works fairly well, although a truly
recursive subroutine would probably be faster.

@dirs = @ARGV;  #Must be full path!
foreach $dir(@dirs){
        if($dir !~ /\\$/){
                $dir .= "\\";
        }
        print "READING $dir...\n\n";
        opendir(DIR,$dir) || print "Could not open $dir!";
        @dir = readdir(DIR);
        closedir(DIR);
        foreach $file(@dir){
                unless($file eq "." || $file eq ".."){
                        if(-e $dir.$file && -d $dir.$file){
                                print "DIR -- ".$dir.$file."\n";
                                push @dirs,$dir.$file."\\";
                        }elsif(-e $dir.$file){
                                print "FIL -- ".$dir.$file."\n";
                        }else{
                                print "Error\:  No such file --
".$dir.$file."!\n";
                        }
                }
        }
        undef @dir;
}

-----Original Message-----
From: rAuL [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 01, 2002 11:18 AM
To: Edgington, Jeffrey
Cc: rAuL; [EMAIL PROTECTED]
Subject: RE: Copying Sub-Directories


This would not do becuase I once had a situation where the verswion of XCOPY
on Windows 2000 was different from the one with NT 4.0.

On 01 Apr 2002, Edgington, Jeffrey wrote:

> I would use xcopy though.
>
> system ("xcopy <source> <dest> \/E \/-Y");
>
> /E - copies dirs and subdirs including
> empty ones.
>
> /-Y -no prompting when overwriting
>
> Just do 'xcopy /?' at a cmd to look at
> additional options for copy.
>
> jeff e.
>
>
>
> -----Original Message----- From: rAuL
> [mailto:[EMAIL PROTECTED]] Sent: Monday,
> April 01, 2002 1:02 PM To:
> [EMAIL PROTECTED]
> Subject: Copying Sub-Directories
>
>
>
> Much to my surprise and inexperience, I cannot
> find a Perl command to do wilcard copying of
> files and subdirectoies within a directory. Is
> there such a thing?
>
> Thanks
> _____________________________________________-
> __
> Perl-Win32-Admin mailing list
> [EMAIL PROTECTED] To
> unsubscribe: http://listserv.ActiveState.com/-
> mailman/mysubs
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


--------------------------------------------------------------------------------
This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to