rpath.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:rdiff-backup 作者: sol1 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号