[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2329: cp -r stops with an exception

Tahoe-LAFS trac at tahoe-lafs.org
Tue Mar 3 20:41:57 UTC 2015


#2329: cp -r stops with an exception
-------------------------+-------------------------------------------------
     Reporter:  zooko    |      Owner:  warner
         Type:  defect   |     Status:  assigned
     Priority:  major    |  Milestone:  1.10.1
    Component:  code-    |    Version:  1.10.0
  frontend-cli           |   Keywords:  regression tahoe-cp review-needed
   Resolution:           |  release-blocker
Launchpad Bug:           |
-------------------------+-------------------------------------------------

Comment (by warner):

 I guess there are a couple of different forms we should examine.

 * `cp -r foo/dir bar/dir TARGETDIR`
 * `cp -r DIRCAP1 DIRCAP2 TARGETDIR`

 The first is using two named directories that both happen to have the same
 name. This will cause `TARGETDIR/dir` to be created, and the contents of
 the sources merged into it.

 The second is using ''unnamed'' directories, triggering our "unnamed
 directories refer to the contents, not the bag itself" rule. Their
 contents will be merged into TARGETDIR.

 `/bin/cp` doesn't have unnamed directories, so the only way to simulate
 the contents-not-bag rule is to use `/bin/cp -r DIR1/* DIR2/* TARGETDIR`,
 in which case any name collisions are obvious on the post-glob-expansion
 argv that's passed from the shell to `cp`. I think (but I'm not sure) that
 the only way to wind up with collisions in `/bin/cp` is if the basename of
 two SOURCE arguments are the same, since `/bin/cp` always uses the
 basename of the source to create a child of the target.

 (in other words, `/bin/cp` may not actually give us precedent to follow)

--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2329#comment:47>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list