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

Function mayCopyFile

lib/internal/fs/cp/cp.js:245–258  ·  view source on GitHub ↗
(srcStat, src, dest, opts)

Source from the content-addressed store, hash-verified

243}
244
245async function mayCopyFile(srcStat, src, dest, opts) {
246 if (opts.force) {
247 await unlink(dest);
248 return _copyFile(srcStat, src, dest, opts);
249 } else if (opts.errorOnExist) {
250 throw new ERR_FS_CP_EEXIST({
251 message: `${dest} already exists`,
252 path: dest,
253 syscall: 'cp',
254 errno: EEXIST,
255 code: 'EEXIST',
256 });
257 }
258}
259
260async function _copyFile(srcStat, src, dest, opts) {
261 await copyFile(src, dest, opts.mode);

Callers 1

onFileFunction · 0.85

Calls 2

_copyFileFunction · 0.85
unlinkFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…