tcf22 has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to convert a VBScript for creating an FTP/Website in IIS. I have the script working using Win32::OLE, but the first part of the process is to make a copy of a template folder. I have this working using the converted VBScript, here is a sample.
use Win32::OLE; Win32::OLE->Option(Warn => 3); #die on error ... #Create Physical Folders eval{ my $fs = Win32::OLE->CreateObject("Scripting.FileSystemObject"); $fs->CopyFolder("$PhysicalPath\\Template", "$PhysicalPath\\$SiteNum" +, 1); }; if($@){ #Some error handling stuff here }
I would rather do this part in perl without any OLE objects. Does anyone know of a module that provides an interface for copying a folder and its contents?

thanks

Replies are listed 'Best First'.
Re: Folder Copy
by particle (Vicar) on May 07, 2003 at 15:13 UTC

    try using File::NCopy, it works like a charm.

    ~Particle *accelerates*

Re: Folder Copy
by nite_man (Deacon) on May 07, 2003 at 15:16 UTC
    Try to use a module File::NCopy. Its functionalty is very similar to cp UNIX/Linux command.
    use File::NCopy; $file = File::NCopy->new(recursive => 1); $file->copy($dir1, $dir2); # Copy $dir1 to $dir2 recursively
          
    --------------------------------
    SV* sv_bless(SV* sv, HV* stash);