mirror of
https://github.com/python/cpython.git
synced 2025-07-30 14:44:10 +00:00
Patch #1490190: posixmodule now includes os.chflags() and os.lchflags()
functions on platforms where the underlying system calls are available.
This commit is contained in:
parent
0713a68dc5
commit
382abeff0f
11 changed files with 133 additions and 10 deletions
|
@ -60,13 +60,15 @@ def copymode(src, dst):
|
|||
os.chmod(dst, mode)
|
||||
|
||||
def copystat(src, dst):
|
||||
"""Copy all stat info (mode bits, atime and mtime) from src to dst"""
|
||||
"""Copy all stat info (mode bits, atime, mtime, flags) from src to dst"""
|
||||
st = os.stat(src)
|
||||
mode = stat.S_IMODE(st.st_mode)
|
||||
if hasattr(os, 'utime'):
|
||||
os.utime(dst, (st.st_atime, st.st_mtime))
|
||||
if hasattr(os, 'chmod'):
|
||||
os.chmod(dst, mode)
|
||||
if hasattr(os, 'chflags') and hasattr(st, 'st_flags'):
|
||||
os.chflags(dst, st.st_flags)
|
||||
|
||||
|
||||
def copy(src, dst):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue