[tahoe-dev] [tahoe-lafs] #705: "tahoe mv" unlinks the target even when it is a directory

tahoe-lafs trac at allmydata.org
Mon Jul 6 23:08:20 PDT 2009


#705: "tahoe mv" unlinks the target even when it is a directory
-------------------------------+--------------------------------------------
 Reporter:  zooko              |           Owner:       
     Type:  defect             |          Status:  new  
 Priority:  critical           |       Milestone:  1.5.0
Component:  code-frontend-cli  |         Version:  1.4.1
 Keywords:  reliability        |   Launchpad_bug:       
-------------------------------+--------------------------------------------

Comment(by kevan):

 The test passes because it's testing the filesystem layer, while
 {{{tahoe_mv.py}}} uses the webapi.

 Basically, we want {{{tahoe mv}}} to do the following:

   * If we're doing {{{tahoe mv file1 file2}}}, {{{file1}}} should replace
 {{{file2}}}.
   * If we're doing {{{tahoe mv file1 folder1/}}}, {{{file1}}} should be
 inserted into {{{folder1}}}.
   * If we're doing {{{tahoe mv file1 folder1}}}, {{{tahoe mv}}} should
 print an error.

 To the user, this looks more or less the same regardless of how we do it
 on the backend -- {{{tahoe mv}}} should output "OK" in the first two
 cases, and an error message in the second. I'm attaching some tests that
 make sure that happens.

 I guess there are a few ways to implement this sort of functionality.

   * We could rely on the CLI (i.e., {{{tahoe mv}}}) to be smart enough to
 distinguish between files and folders, and structure HTTP requests
 appropriately. By using the methods described in {{{=== Get Information
 About A File Or Directory (as JSON) ===}}}, we can easily (and rather
 laboriously) determine whether the target is a file or a directory, and
 then act accordingly.
   * Alternatively, we could maybe bake some sort of functionality into the
 webapi that covers this. I'm not sure of the best way to do this, though.

-- 
Ticket URL: <http://allmydata.org/trac/tahoe/ticket/705#comment:7>
tahoe-lafs <http://allmydata.org>
secure decentralized file storage grid


More information about the tahoe-dev mailing list