#712 closed defect

tahoe cp flattens directories — at Version 6

Reported by: zooko Owned by: daira
Priority: major Milestone: 1.10.1
Component: code-frontend-cli Version: 1.4.1
Keywords: tahoe-cp usability docs backward-compatibility Cc:
Launchpad Bug:

Description (last modified by daira)

I had two entries in my local filesystem, a file named "22brain.html" and a directory named "22brain_files", which was full of other files and subdirectories. I ran {{tahoe cp 22brain* tahoe:22brain/}}}. Afterward I expected to find tahoe:22brain/22brain.html and tahoe:22brain/22brain_files/, but instead I found the contents of the local "22brain_files" directory copied directly into the tahoe:22brain directory. This breaks all the links in the "22brain.html" file and means I need to delete this directory and try again.

Change History (6)

comment:1 Changed at 2009-05-23T21:15:33Z by zooko

I see that the same thing happens if I run tahoe cp -r 22brain_files tahoe:22brain/.

See also #705 ("tahoe mv" unlinks the target even when it is a directory).

comment:2 Changed at 2010-04-13T00:56:07Z by davidsarah

  • Keywords tahoe-cp usability added

comment:3 Changed at 2012-11-26T00:16:50Z by davidsarah

  • Milestone changed from eventually to 1.11.0

zooko forgot he had filed this ticket :-) and wrote in the duplicate ticket #1854 :

$ ls -al
total 1740
drwxrwxr-x 3 zooko zooko   4096 Nov 11 04:56 .
drwxrwxr-x 3 zooko zooko   4096 Nov 11 04:52 ..
-rw-rw-r-- 1 zooko zooko  80898 Aug 21 19:23 276a292eebb111e186fe22000a1c9ebd_7.jpg
-rw-rw-r-- 1 zooko zooko  96881 Nov 10 03:48 causes-of-death-2010.png
-rw-rw-r-- 1 zooko zooko  20450 Nov 11 04:52 hackers-2012-slides.html
-rw-rw-r-- 1 zooko zooko  11458 Nov 10 14:57 hackers-2012-slides.rst
-rw-rw-r-- 1 zooko zooko 948821 Nov 10 03:46 Murphy-2012-Deaths__Preliminary_Data_For_2010.pdf
-rw-rw-r-- 1 zooko zooko 113191 Nov 10 11:51 Neal-2008-Table4.png
-rw-rw-r-- 1 zooko zooko 117367 Nov 10 10:48 Neal-2008-The_ketogenic_diet_for_the_treatment_of_childhood_epilepsy__a_randomised_controlled_trial.pdf
-rw-rw-r-- 1 zooko zooko 148251 Nov 10 10:37 Neal-2010-Efficacy_Of_Dietary_Treatments_For_Epilepsy.pdf
-rw-rw-r-- 1 zooko zooko 219436 Nov 10 10:42 Neal-2010-Table2.png
drwxrwxr-x 4 zooko zooko   4096 Nov 10 14:04 ui
$ time tahoe cp -r * URI:DIR2-MDMF:qda3lf42dkxclwbuh5h7qwygne:obhqprvm6hafvarzzssrawgazx6p6tgopi4fslirhelg7xqyfr6a:
Success: files copied

real    0m26.085s
user    0m1.003s
sys     0m0.140s
HACK zompu:~/book/gitworld/presentations/hackers-2012$ tahoe ls -l URI:DIR2-MDMF:qda3lf42dkxclwbuh5h7qwygne:obhqprvm6hafvarzzssrawgazx6p6tgopi4fslirhelg7xqyfr6a:
-r--  80898 Nov 11 04:58                                                                  276a292eebb111e186fe22000a1c9ebd_7.jpg
-r-- 948821 Nov 11 04:58                                                       Murphy-2012-Deaths__Preliminary_Data_For_2010.pdf
-r-- 113191 Nov 11 04:58                                                                                    Neal-2008-Table4.png
-r-- 117367 Nov 11 04:58 Neal-2008-The_ketogenic_diet_for_the_treatment_of_childhood_epilepsy__a_randomised_controlled_trial.pdf
-r-- 148251 Nov 11 04:58                                               Neal-2010-Efficacy_Of_Dietary_Treatments_For_Epilepsy.pdf
-r-- 219436 Nov 11 04:58                                                                                    Neal-2010-Table2.png
-r--  96881 Nov 11 04:58                                                                                causes-of-death-2010.png
drwx      - Nov 11 04:56                                                                                                 default
-r--  20450 Nov 11 04:58                                                                                hackers-2012-slides.html
-r--  11458 Nov 11 04:58                                                                                 hackers-2012-slides.rst
drwx      - Nov 11 04:56                                                                                             small-white

This is wrong, causing my slides to be unable to load their CSS when viewed from Tahoe-LAFS (e.g.it looks like https://zooko.com/uri/URI%3ADIR2-MDMF-RO%3Appnrefnrnovjpoiv3jirjnpoim%3Aobhqprvm6hafvarzzssrawgazx6p6tgopi4fslirhelg7xqyfr6a/hackers-2012-slides.html when it should look like this: https://zooko.com/uri/URI:DIR2-MDMF-RO:nmrgdbrmwdta2bfzke4pfttsei:vlijvwz4kncumxkob5um45sni7btqelu4q5oltcl5nqxwjrif2iq/hackers-2012-slides.html).

The result should have been that the directory-and-file structure in the tahoe-lafs dir matched that in the local dir.

comment:4 Changed at 2012-11-26T00:21:39Z by davidsarah

It isn't clear from the bug description or from comment:3 whether it is just that a directory specified in the command line won't be created as a directory in the destination, or whether all subdirectories will be flattened.

comment:5 Changed at 2012-11-26T00:33:52Z by davidsarah

  • Keywords recursive test-needed added

comment:6 Changed at 2013-08-02T15:55:52Z by daira

  • Description modified (diff)
  • Owner changed from warner to daira
  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.