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

Function rename

lib/internal/vfs/setup.js:601–606  ·  view source on GitHub ↗
(oldPath, newPath)

Source from the content-addressed store, hash-verified

599 rm: (path, options) => vfsOp(path, (vfs, n) => vfs.promises.rm(n, options).then(() => true)),
600 unlink: (path) => vfsOp(path, (vfs, n) => vfs.promises.unlink(n).then(() => true)),
601 rename(oldPath, newPath) {
602 return vfsOp(oldPath, (vfs, n) => {
603 checkSameVFS(n, toPathStr(newPath), 'rename', vfs);
604 return vfs.promises.rename(n, resolve(toPathStr(newPath))).then(() => true);
605 });
606 },
607 copyFile(src, dest, mode) {
608 return vfsOp(src, (vfs, n) => {
609 checkSameVFS(n, toPathStr(dest), 'copyfile', vfs);

Callers

nothing calls this directly

Calls 6

vfsOpFunction · 0.85
checkSameVFSFunction · 0.85
toPathStrFunction · 0.85
resolveFunction · 0.50
thenMethod · 0.45
renameMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…