If REMOTE_FILE is missing, upload the file but do not link it into a
directory; also print the new filecap to stdout. If LOCAL_FILE is missing
or '-', data will be copied from stdin. REMOTE_FILE is assumed to start
- with tahoe: unless otherwise specified."""
+ with tahoe: unless otherwise specified.
+
+ If the destination file already exists and is mutable, it will be modified
+ in-place, whether or not --mutable is specified. (--mutable only affects
+ creation of new files.)"""
def getUsage(self, width=None):
t = VDriveOptions.getUsage(self, width)
d = self.do_cli("create-alias", "tahoe")
d.addCallback(lambda res:
self.do_cli("put", "--mutable", fn1, "tahoe:uploaded.txt"))
+ def _check(res):
+ (rc, out, err) = res
+ self.failUnlessEqual(rc, 0, str(res))
+ self.failUnlessEqual(err, "", str(res))
+ self.uri = out
+ d.addCallback(_check)
d.addCallback(lambda res:
self.do_cli("put", fn2, "tahoe:uploaded.txt"))
+ def _check2(res):
+ (rc, out, err) = res
+ self.failUnlessEqual(rc, 0, str(res))
+ self.failUnlessEqual(err, "", str(res))
+ self.failUnlessEqual(out, self.uri, str(res))
+ d.addCallback(_check2)
d.addCallback(lambda res:
self.do_cli("get", "tahoe:uploaded.txt"))
d.addCallback(lambda (rc,out,err): self.failUnlessReallyEqual(out, DATA2))