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