g_speran has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
I am wanting to copy a directory and all of its contents, including files and subdirectories, to another location. In addition, there are certain file extensions that may exist that I do not want copied, such as .lck which the script needs to account for. Unfortunatly, my search endevours have produced no hits.
I am running this on windows. I have explored XCOPY but Xcopy does not have a way to exclude or match a regular expression. I also was using File::Copy and File::Path. This was working, until it came upon a subdirectory. In which case the sub directory and the contents in the subdirectory were not copied to the new location.
So in a nutshell, i need to do exactally what "xcopy /E /I /F /R <source> <destination>" would do except that I need it to look for files such as ".lck" files and not copy them over
Any help and sample script would greatly be appreciated on how to accomplish this task
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Copy files and subdirectories
by matze77 (Friar) on Jun 09, 2011 at 15:25 UTC | |
by g_speran (Scribe) on Jun 09, 2011 at 16:15 UTC | |
|
Re: Copy files and subdirectories
by BrowserUk (Patriarch) on Jun 10, 2011 at 00:35 UTC | |
|
Re: Copy files and subdirectories
by eye (Chaplain) on Jun 10, 2011 at 00:23 UTC |