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

Function handleTimestampsAndMode

lib/internal/fs/cp/cp.js:268–276  ·  view source on GitHub ↗
(srcMode, src, dest)

Source from the content-addressed store, hash-verified

266}
267
268async function handleTimestampsAndMode(srcMode, src, dest) {
269 // Make sure the file is writable before setting the timestamp
270 // otherwise open fails with EPERM when invoked with 'r+'
271 // (through utimes call)
272 if (fileIsNotWritable(srcMode)) {
273 await makeFileWritable(dest, srcMode);
274 }
275 return setDestTimestampsAndMode(srcMode, src, dest);
276}
277
278function fileIsNotWritable(srcMode) {
279 return (srcMode & 0o200) === 0;

Callers 1

_copyFileFunction · 0.85

Calls 3

setDestTimestampsAndModeFunction · 0.85
fileIsNotWritableFunction · 0.70
makeFileWritableFunction · 0.70

Tested by

no test coverage detected