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

Function linkSync

lib/fs.js:2291–2305  ·  view source on GitHub ↗

* Synchronously creates a new link from the `existingPath` * to the `newPath`. * @param {string | Buffer | URL} existingPath * @param {string | Buffer | URL} newPath * @returns {void}

(existingPath, newPath)

Source from the content-addressed store, hash-verified

2289 * @returns {void}
2290 */
2291function linkSync(existingPath, newPath) {
2292 const h = vfsState.handlers;
2293 if (h !== null) {
2294 const result = h.linkSync(existingPath, newPath);
2295 if (result !== undefined) return;
2296 }
2297
2298 existingPath = getValidatedPath(existingPath, 'existingPath');
2299 newPath = getValidatedPath(newPath, 'newPath');
2300
2301 binding.link(
2302 existingPath,
2303 newPath,
2304 );
2305}
2306
2307/**
2308 * Asynchronously removes a file or symbolic link.

Callers

nothing calls this directly

Calls 2

linkSyncMethod · 0.45
linkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…