Skip to content

Commit 4209414

Browse files
committed
Adjust timestamp handling in sync_tree ficlone method
FICLONE method does not preserve timestamp it/e3-core#80 it/e3-core#70 it/e3-core#79
1 parent b526dda commit 4209414

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/e3/fs.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,10 +1203,8 @@ def safe_copy_ficlone(src: FileInfo, dst: FileInfo) -> None:
12031203
# If dst was already a file open does not adjust the mode
12041204
os.fchmod(dst_fd, src.stat.st_mode)
12051205

1206-
if not preserve_timestamps and os_utime:
1207-
# By default FICLONE preserve timestamps. So adjust timestamp to now
1208-
# only if preserve_timestamps is False.
1209-
os_utime(dst_fd, None)
1206+
if preserve_timestamps and os_utime:
1207+
os_utime(dst_fd, ns=(src.stat.st_atime_ns, src.stat.st_mtime_ns))
12101208

12111209
except OSError:
12121210
# We will probably have the same issue with all files

0 commit comments

Comments
 (0)