On 10/19/07, Nick Guenther <[EMAIL PROTECTED]> wrote: > On 10/19/07, Paul de Weerd <[EMAIL PROTECTED]> wrote: > > On Fri, Oct 19, 2007 at 01:52:03PM -0400, Douglas A. Tutty wrote: > > | Conceptually, though, why can't cp look at the source directory and take a > > | snapshot, a to-do-list, of everything it has to copy, then do it? That > > | way, any recursion would be completed before the target directory > > | appeared in the source directory. With only an -R (no -H -L or -P), it > > | should copy links as links which should avoid loops. > > > > What will you do if the underlying directory structure has tons and > > tons of files and subdirectories ? First traverse this entire tree, > > keeping it all in memory ? Sounds pretty expensive. > > Could you scan the tree only for recursions? You wouldn't have to keep > it all in memory, only the problem points, maybe?
the other thing you can do is not copy directories into themselves. it's very easy. i'm not copying a directory into itself right now. i can even not do this while sleeping.