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

Function onFile

lib/internal/fs/cp/cp-sync.js:82–98  ·  view source on GitHub ↗
(srcStat, destStat, src, dest, opts)

Source from the content-addressed store, hash-verified

80}
81
82function onFile(srcStat, destStat, src, dest, opts) {
83 if (!destStat) return copyFile(srcStat, src, dest, opts);
84
85 if (opts.force) {
86 return fsBinding.cpSyncOverrideFile(src, dest, opts.mode, opts.preserveTimestamps);
87 }
88
89 if (opts.errorOnExist) {
90 throw new ERR_FS_CP_EEXIST({
91 message: `${dest} already exists`,
92 path: dest,
93 syscall: 'cp',
94 errno: EEXIST,
95 code: 'EEXIST',
96 });
97 }
98}
99
100function copyFile(srcStat, src, dest, opts) {
101 copyFileSync(src, dest, opts.mode);

Callers 1

getStatsFunction · 0.70

Calls 1

copyFileFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…