That's if you have that module loaded   :-)

Ned Cunningham
POS Systems Development
Monro Muffler Brake
200 Holleder Parkway
Rochester, NY 14615
(585) 647-6400 ext. 310
[EMAIL PROTECTED]

                -----Original Message-----
                From:   [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lynn. 
Rickards
                Sent:   Thursday, November 13, 2003 11:26 AM
                To:     'John Deretich'; 'Perl-Win32-Admin-Request (E-mail)'
                Subject:        RE: copy files and directories



                > -----Original Message-----
                > From: [EMAIL PROTECTED]
                > [mailto:[EMAIL PROTECTED] Behalf Of
                > John Deretich
                > Sent: Thursday, November 13, 2003 10:27 AM
                > To: Perl-Win32-Admin-Request (E-mail)
                > Subject: copy files and directories
                > 
                > 
                > Hello,
                > 
                > can anyone tell me how to do
                > a complete copy of files and directories
                > from one directory to another?
                > I tried system('copy g:\*.* F:\test\test2')
                > with no success.
                > 
                > thanks,
                > 

                Avoid platform dependency and use File::Ncopy
                available on ppm 

                use File::NCopy  qw(copy);

                my $fc = File::NCopy->new(recursive => 1);

                my $source = "d:/dir1";
                my $dest = "c:/dir2";

                die "nonesuch $source" unless(-d $source);
                die "nonesuch $dest" unless(-d $dest);

                $fc->copy($source, $dest) or die "Problem copying - $!\n";

                Note $dest must exist.

                HTH - Lynn.
                _______________________________________________
                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

Reply via email to