from_file = options.from_file
to_file = options.to_file
mutable = options['mutable']
+ mutable_type = False
+
+ if mutable:
+ mutable_type = options['mutable-type']
if options['quiet']:
verbosity = 0
else:
# DIRCAP:./subdir/foo : DIRCAP/subdir/foo
# MUTABLE-FILE-WRITECAP : filecap
- # FIXME: this shouldn't rely on a particular prefix.
- if to_file.startswith("URI:SSK:"):
+ # FIXME: don't hardcode cap format.
+ if to_file.startswith("URI:MDMF:") or to_file.startswith("URI:SSK:"):
url = nodeurl + "uri/%s" % urllib.quote(to_file)
else:
try:
url = nodeurl + "uri"
if mutable:
url += "?mutable=true"
+ if mutable_type:
+ assert mutable
+ url += "&mutable-type=%s" % mutable_type
+
if from_file:
infileobj = open(os.path.expanduser(from_file), "rb")
else: