[tahoe-lafs-trac-stream] [tahoe-lafs] #835: "tahoe cp -r --mutable/--immutable": make mutable copy of immutable directories or vice versa

tahoe-lafs trac at tahoe-lafs.org
Sat Dec 14 18:18:36 UTC 2013


#835: "tahoe cp -r --mutable/--immutable": make mutable copy of immutable
directories or vice versa
-----------------------------------+--------------------------------
     Reporter:  warner             |      Owner:
         Type:  enhancement        |     Status:  new
     Priority:  major              |  Milestone:  soon
    Component:  code-frontend-cli  |    Version:  1.5.0
   Resolution:                     |   Keywords:  usability tahoe-cp
Launchpad Bug:                     |
-----------------------------------+--------------------------------
Changes (by daira):

 * cc: amontero (added)


Old 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.

New 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.

--

Comment:

 amontero asked for this feature (`cp -r --immutable`) on #tahoe-lafs:

 > how do I put an entire tree into an immutable dir in one single command
 and get its URI?

 > tahoe-backup would be perfect just if it dumped the URI after the
 "creating directory for 'Archives/2013-12-14_14:24:38Z/'"

-- 
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/835#comment:12>
tahoe-lafs <https://tahoe-lafs.org>
secure decentralized storage


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