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
评论列表
文章目录