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

I'm trying to copy a directory struture recursively in Perl and came across File::NCopy.

I'm doing the following:

my $file = File::NCopy->new(recursive => 1); $file->copy($wherefrom,$whereto);
It doesn't work when I specify an absolute path to the directory(i.e. $wherefrom = 'C:/Foo/Path/Directory')

Any ideas why?

Replies are listed 'Best First'.
Re: File::NCopy issue
by jdalbec (Deacon) on Aug 04, 2004 at 02:31 UTC
    From the SYNOPSIS:

    On Unix boxes you shouldn't need to worry. On other system you may want to supply your own sub references.

    ...
    $file = File::NCopy->new(u_chmod => \&my_chmod,f_check => \&my_fcheck) +; $file->copy "directory1","directory2";
    Maybe the default f_check has problems with Windows absolute path names. If it's designed for Unix it probably thinks they're relative path names.

    By the fact that you said "it doesn't work" I can see that you need to read How (Not) To Ask A Question. Please do.