in reply to copying a directory and it's contents
I generally do this:
But that's not entirely perlish. For large amounts of copying (large files, large numbers of files), it may be more efficient to do this simply because then you don't need to do much, and the overhead of forking and setting up pipes is greatly minimised by the actual work. For small numbers of files in small numbers of directories, it's probably still worth it simply to avoid development effort.$ (cd $srcdir; tar cf - *) | (cd $dstdir; tar xf -)
(cf File::DirSync which looks really cool, but if you're not syncing but actually just copying from source to destination, and am not going to need to resync it later, may be a bit of an overkill.)
|
|---|