increment.py 文件源码

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

项目:rdiff-backup 作者: sol1 项目源码 文件源码
def Increment(new, mirror, incpref):
    """Main file incrementing function, returns inc file created

    new is the file on the active partition,
    mirror is the mirrored file from the last backup,
    incpref is the prefix of the increment file.

    This function basically moves the information about the mirror
    file to incpref.

    """
    log.Log("Incrementing mirror file " + mirror.path, 5)
    if ((new and new.isdir()) or mirror.isdir()) and not incpref.lstat():
        incpref.mkdir()

    if not mirror.lstat(): incrp = makemissing(incpref)
    elif mirror.isdir(): incrp = makedir(mirror, incpref)
    elif new.isreg() and mirror.isreg():
        incrp = makediff(new, mirror, incpref)
    else: incrp = makesnapshot(mirror, incpref)
    statistics.process_increment(incrp)
    return incrp
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号