(srcMode, src, dest)
| 266 | } |
| 267 | |
| 268 | async 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 | |
| 278 | function fileIsNotWritable(srcMode) { |
| 279 | return (srcMode & 0o200) === 0; |
no test coverage detected