(srcMode, src, dest)
| 104 | } |
| 105 | |
| 106 | function 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 | |
| 114 | function fileIsNotWritable(srcMode) { |
| 115 | return (srcMode & 0o200) === 0; |
no test coverage detected