extract: support extraction of atime/mtime on win32

This commit is contained in:
Thomas Waldmann 2023-04-16 18:46:40 +02:00
parent 9e534c1929
commit 7786cc7cb4
No known key found for this signature in database
GPG Key ID: 243ACFA951F78E01
1 changed files with 10 additions and 0 deletions

View File

@ -984,6 +984,16 @@ Duration: {0.duration}
set_flags(path, item.bsdflags, fd=fd)
except OSError:
pass
else: # win32
# set timestamps rather late
mtime = item.mtime
atime = item.atime if "atime" in item else mtime
try:
# note: no fd support on win32
os.utime(path, None, ns=(atime, mtime))
except OSError:
# some systems don't support calling utime on a symlink
pass
def set_meta(self, key, value):
metadata = self._load_meta(self.id)