Opened at 2009-11-20T04:02:57Z
Last modified at 2013-12-14T20:04:49Z
#835 new enhancement
"tahoe cp -r --mutable": make mutable copy of immutable directories, vice versa — at Initial Version
Reported by: | warner | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | soon |
Component: | code-frontend-cli | Version: | 1.5.0 |
Keywords: | usability tahoe-cp | Cc: | kpreid, amontero |
Launchpad Bug: |
Description
Now that we have immutable directories (#607), we could use some CLI commands to take advantage of them. #828 is about having "tahoe backup" create immutable directories, but what if you want to convert those immutable directories into a form that you can modify again? tahoe cp seems like the most appropriate tool.
There are a couple of interesting forms of copying that could be done. (In each case, we're talking about directories, and not files.)
- original is immutable: make immutable copy (re-use same object)
- original is immutable: make mutable copy
- original is mutable: make mutable copy
- original is mutable: make immutable copy
The default for cp -r should be to use the same type of object: mutable-to-mutable or immutable-to-immutable (and of course, immutable-to-immutable means we just re-use the original dircap).
I think that tahoe cp should acquire a --mutable flag which tells it to always create mutable directories, even if the original was immutable. This would be used to convert your "tahoe backup" -created immutable directories into a form that you can modify.
Likewise, I think it should have a --immutable flag which tells it to always create immutable directories.
I think that files should be handled differently: basically the default should be mutable-to-mutable and immutable-gets-shared. If you copy with --immutable, then clearly that will trigger mutable-to-immutable (since immutable dirnodes are deep-immutable, so we can't fill them with mutable files). But if you copy with --mutable, I think we should create mutable dirnodes with immutable files. A separate flag (maybe --mutable-files) could be used if you really do want to turn all of your immutable files into mutable ones.