MCPcopy Create free account
hub / github.com/nodejs/node / handleTimestamps

Function handleTimestamps

lib/internal/fs/cp/cp-sync.js:106–112  ·  view source on GitHub ↗
(srcMode, src, dest)

Source from the content-addressed store, hash-verified

104}
105
106function handleTimestamps(srcMode, src, dest) {
107 // Make sure the file is writable before setting the timestamp
108 // otherwise open fails with EPERM when invoked with 'r+'
109 // (through utimes call)
110 if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode);
111 return setDestTimestamps(src, dest);
112}
113
114function fileIsNotWritable(srcMode) {
115 return (srcMode & 0o200) === 0;

Callers 1

copyFileFunction · 0.85

Calls 3

fileIsNotWritableFunction · 0.70
makeFileWritableFunction · 0.70
setDestTimestampsFunction · 0.70

Tested by

no test coverage detected