backups.py 文件源码

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

项目:smartbackup 作者: baszoetekouw 项目源码 文件源码
def get_stamp(stampdir):
    stampfile = os.path.join(stampdir,'stamp')

    # read first line of stamp file
    f = open(stampfile,mode='rt')
    line = f.readline()
    f.close()

    # extract timestamp (first field of line) and compare to others
    stamp = int( line.split().pop(0) )
    if not stamp>0:
        raise BackupError("Can't read `{}'".format(stampfile))

    dt = datetime.utcfromtimestamp(stamp)
    return dt

# find a list of backups for a particular machine
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号