def do_put(self, arg, rpath=""):
"Send file: put <local file>"
if not arg:
arg = raw_input("Local file: ")
if not rpath:
rpath = os.path.basename(arg)
rpath = self.rpath(rpath)
lpath = os.path.abspath(arg)
# read from local file
data = file().read(lpath)
if data != None:
self.put(rpath, data)
lsize = len(data)
rsize = self.file_exists(rpath)
if rsize == lsize:
print(str(rsize) + " bytes transferred.")
elif rsize == c.NONEXISTENT:
print("Permission denied.")
else:
self.size_mismatch(lsize, rsize)
# ------------------------[ append <file> <string> ]------------------
评论列表
文章目录