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

Hello everybody!
I need to copy folder from one place to another, and the problem is, that this folder may include folders that also include folders in additional to files. I can't find a function that copies the whole folder with it's contents.

Does anybody can solve this problem?

  • Comment on Copying whole folder that include another folder and files.

Replies are listed 'Best First'.
Re: Copying whole folder that include another folder and files.
by matija (Priest) on Apr 25, 2004 at 08:18 UTC
    Well, you could use GNU cp, or you could use rsync, or you could go the Perl way, and use File::NCopy. It supports recursive copying, setting permissions, and more...
Re: Copying whole folder that include another folder and files.
by fluxion (Monk) on Apr 25, 2004 at 15:18 UTC
    File::Find will cure what ails you. You probably should have searched CPAN before posting this.

    Roses are red, violets are blue. All my base, are belong to you.
      Rolling your own with File::Find may not be as intuitive for new perl users as you imagine. There exist some other modules such as File::NCopy that do what the OP wants.


      -Waswas
        THANKS TO ALL OF YOU!!!!!!!