* Creates a new link from the `existingPath` * to the `newPath`. * @param {string | Buffer | URL} existingPath * @param {string | Buffer | URL} newPath * @param {(err?: Error) => any} callback * @returns {void}
(existingPath, newPath, callback)
| 2267 | * @returns {void} |
| 2268 | */ |
| 2269 | function link(existingPath, newPath, callback) { |
| 2270 | callback = makeCallback(callback); |
| 2271 | |
| 2272 | const h = vfsState.handlers; |
| 2273 | if (h !== null && vfsVoid(h.link(existingPath, newPath), callback)) return; |
| 2274 | |
| 2275 | existingPath = getValidatedPath(existingPath, 'existingPath'); |
| 2276 | newPath = getValidatedPath(newPath, 'newPath'); |
| 2277 | |
| 2278 | const req = new FSReqCallback(); |
| 2279 | req.oncomplete = callback; |
| 2280 | |
| 2281 | binding.link(existingPath, newPath, req); |
| 2282 | } |
| 2283 | |
| 2284 | /** |
| 2285 | * Synchronously creates a new link from the `existingPath` |
nothing calls this directly
no test coverage detected
searching dependent graphs…