#1853 closed defect (fixed)

"tahoe cp" breaks when files have a : char in their names

Reported by: zooko Owned by: zooko
Priority: normal Milestone: undecided
Component: code-frontend-cli Version: 1.9.2
Keywords: usability aliases docs Cc:
Launchpad Bug:

Description

I'm not sure how to fix this. I don't want tahoe to refuse to process my files which have : in their names, much less to attempt to do something incorrect and potentially destructive, should the prefix of such a file happen to match a tahoe alias. The fact that I have to squeeze my caps and filenames into the same namespace with aliases — a feature that I don't like and don't use — is frustrating to me.

$ tahoe cp -r * URI:DIR2-MDMF:qda3lf42dkxclwbuh5h7qwygne:obhqprvm6hafvarzzssrawgazx6p6tgopi4fslirhelg7xqyfr6a:
error: Unknown alias 'Neal-2008-The_ketogenic_diet_for_the_treatment_of_childhood_epilepsy', please create it with 'tahoe add-alias' or 'tahoe create-alias'.
$ ls -aldtr * .*
-rw-rw-r-- 1 zooko zooko  80898 Aug 21 19:23 276a292eebb111e186fe22000a1c9ebd_7.jpg
-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  96881 Nov 10 03:48 causes-of-death-2010.png
-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
-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 113191 Nov 10 11:51 Neal-2008-Table4.png
drwxrwxr-x 4 zooko zooko   4096 Nov 10 14:04 ui
-rw-rw-r-- 1 zooko zooko  11458 Nov 10 14:57 hackers-2012-slides.rst
drwxrwxr-x 3 zooko zooko   4096 Nov 11 04:52 ..
-rw-rw-r-- 1 zooko zooko  20450 Nov 11 04:52 hackers-2012-slides.html
drwxrwxr-x 3 zooko zooko   4096 Nov 11 04:52 .
$ mv Neal-2008-The_ketogenic_diet_for_the_treatment_of_childhood_epilepsy\:_a_randomised_controlled_trial.pdf Neal-2008-The_ketogenic_diet_for_the_treatment_of_childhood_epilepsy__a_randomised_controlled_trial.pdf 
$ tahoe cp -r * URI:DIR2-MDMF:qda3lf42dkxclwbuh5h7qwygne:obhqprvm6hafvarzzssrawgazx6p6tgopi4fslirhelg7xqyfr6a:
Success: files copied

Change History (4)

comment:1 Changed at 2012-11-11T15:08:12Z by davidsarah

  • Keywords docs added
  • Owner set to davidsarah
  • Status changed from new to assigned

Try tahoe cp -r ./* URI:...

Since aliases cannot contain '/', the '/' before the colon is enough to tell Tahoe that the colon does not imply an alias (see git/src/allmydata/scripts/common.py#L185). This "./*" trick also ensures that a filename expansion is not misinterpreted as an option (works for any Unix command).

This should be documented in git/docs/frontends/CLI.rst; will fix.

comment:2 Changed at 2012-11-11T15:53:00Z by David-Sarah Hopwood <david-sarah@…>

In 86471233f0556f6c:

docs/frontends/CLI.rst: document ./* trick, and that aliases should not be a single char on Windows.
Also fix some rst2html warnings. refs #1853, #1840

Signed-off-by: David-Sarah Hopwood <david-sarah@…>

comment:3 Changed at 2012-11-11T15:54:33Z by davidsarah

  • Owner changed from davidsarah to zooko
  • Status changed from assigned to new

Is this doc fix sufficient?

comment:4 Changed at 2012-11-16T04:47:16Z by zooko

  • Resolution set to fixed
  • Status changed from new to closed

Yes, +1 on 86471233f0556f6c. Thanks!

Note: See TracTickets for help on using tickets.