fs: preserve directory timestamps in cpSync fast path · nodejs/node@9227f17 · GitHub
Skip to content

Commit 9227f17

Browse files
committed
fs: preserve directory timestamps in cpSync fast path
This completes the work started in PR #65540. The previous PR fixed directory timestamp preservation for the JavaScript paths, but the native C++ fast path (CpSyncCopyDir in src/node_file.cc) used by fs.cpSync when no filter is provided still failed to preserve directory timestamps. This commit invokes the existing CopyUtimes helper for both the root destination directory and all subdirectories after their contents are recursively copied, aligning the native behavior with the JavaScript fallback. PR-URL: #65678 Signed-off-by: Abhinandan Kumar <abhi128618@gmail.com>
1 parent 104285a commit 9227f17

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

‎src/node_file.cc‎

Lines changed: 7 additions & 1 deletion

‎test/parallel/test-fs-cp-sync-preserve-timestamps-dir.mjs‎

Lines changed: 21 additions & 2 deletions

0 commit comments

Comments
 (0)