rovf has asked for the wisdom of the Perl Monks concerning the following question:
I'm looking for an elegant way of copying recursively a directory tree (similar to what File::Copy::Recursive does), but with the added twist that I want to exclude certain subdirectories (for example, .svn Subversion directories or tmp Tempdirectories).
One possibility would be to use File::Find, create directories on the fly if needed, and doing nothing if $File::Find::name contains an "unwanted" component in its path.
While this would work, I wonder whether there exists already on CPAN a module with a more convenient interface (for example, a recursive copy function which accepts a pattern of names which should excluded from the copy process). I did a CPAN search, but didn't find anything useful - but maybe I just couldn't find it.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Recursive File Copy question
by moritz (Cardinal) on Jul 21, 2008 at 11:11 UTC | |
by rovf (Priest) on Jul 21, 2008 at 12:10 UTC | |
Re: Recursive File Copy question
by broomduster (Priest) on Jul 21, 2008 at 11:03 UTC | |
by rovf (Priest) on Jul 21, 2008 at 12:13 UTC | |
Re: Recursive File Copy question
by dHarry (Abbot) on Jul 21, 2008 at 14:55 UTC | |
by rovf (Priest) on Jul 22, 2008 at 08:22 UTC | |
Re: Recursive File Copy question
by BrowserUk (Patriarch) on Jul 21, 2008 at 15:17 UTC | |
by rovf (Priest) on Jul 22, 2008 at 08:34 UTC | |
by BrowserUk (Patriarch) on Jul 22, 2008 at 15:05 UTC | |
Re: Recursive File Copy question
by actualize (Monk) on Jul 21, 2008 at 18:02 UTC | |
Re: Recursive File Copy question
by JavaFan (Canon) on Jul 22, 2008 at 13:16 UTC |