Perl Monk, Perl Meditation | |
PerlMonks |
How can I compare two directories and copy over files missing from one to another?by habhab (Acolyte) |
on Sep 17, 2004 at 18:37 UTC ( [id://391870]=perlquestion: print w/replies, xml ) | Need Help?? |
habhab has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks !
I am a beginner looking for some help. I have 2 directories, Source and Target and I would like to take every directory/file in Source dir that is not in Target dir and copy it over to Target dir. This should include sub dirs as well. If dir/file from Source is already in Target, I would like to print its dir/file name. So far I came up with the follwoing code, but it doesnt seem to be working. Usage: perl mergeTrees.pl SourceDir TargetDir
Back to
Seekers of Perl Wisdom
|
|