file_Utils.py 文件源码

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

项目:warriorframework 作者: warriorframework 项目源码 文件源码
def copystat(src, dst):
    """
    Copy the permission bits, last access time, last modification time, and
    flags from src to dst. The file contents, owner, and group are unaffected.
    src and dst are path names given as strings.
    :Arguments:
        src - permission bits of the file to be copied
        dst - file on which permission bits has to be copied
    :Return:
        True/False - based on the success/failure of the operation
    """
    status = False
    try:
        shutil.copystat(src, dst)
        print_info("metadata of src {} copied to dst {} successfully".
                   format(src, dst))
        status = True
    except Exception as e:
        print_error("copying file stat from {} to file {} raised exception {}".
                    format(src, dst, str(e)))
    return status
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号