* 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)
| 2289 | * @returns {void} |
| 2290 | */ |
| 2291 | function 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. |