MCPcopy Index your code
hub / github.com/nodejs/node / copyFileSync

Method copyFileSync

lib/internal/vfs/provider.js:406–417  ·  view source on GitHub ↗

* Copies a file synchronously. * @param {string} src Source path * @param {string} dest Destination path * @param {number} [mode] Copy mode flags

(src, dest, mode)

Source from the content-addressed store, hash-verified

404 * @param {number} [mode] Copy mode flags
405 */
406 copyFileSync(src, dest, mode) {
407 if (this.readonly) {
408 throw createEROFS('copyfile', dest);
409 }
410 if ((mode & COPYFILE_EXCL) !== 0) {
411 if (this.existsSync(dest)) {
412 throw createEEXIST('copyfile', dest);
413 }
414 }
415 const content = this.readFileSync(src);
416 this.writeFileSync(dest, content);
417 }
418
419 /**
420 * Gets the real path by resolving symlinks.

Callers 15

copyFileSyncFunction · 0.45
copyFileSyncFunction · 0.45
mainFunction · 0.45
test.jsFile · 0.45
mainFunction · 0.45
testLoaderFunction · 0.45
copyDirFunction · 0.45

Calls 5

existsSyncMethod · 0.95
readFileSyncMethod · 0.95
writeFileSyncMethod · 0.95
createEROFSFunction · 0.85
createEEXISTFunction · 0.85

Tested by

no test coverage detected