def copy_reg_file(rpin, rpout, compress = 0):
"""Copy regular file rpin to rpout, possibly avoiding connection"""
try:
if (rpout.conn is rpin.conn and
rpout.conn is not Globals.local_connection):
v = rpout.conn.rpath.copy_reg_file(rpin.path, rpout.path, compress)
rpout.setdata()
return v
except AttributeError: pass
try:
return rpout.write_from_fileobj(rpin.open("rb"), compress = compress)
except IOError, e:
if (e.errno == errno.ERANGE):
log.Log.FatalError("'IOError - Result too large' while reading %s. "
"If you are using a Mac, this is probably "
"the result of HFS+ filesystem corruption. "
"Please exclude this file from your backup "
"before proceeding." % rpin.path)
else:
raise
评论列表
文章目录