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

Function lchown

lib/fs.js:2477–2489  ·  view source on GitHub ↗

* Sets the owner of the symbolic link. * @param {string | Buffer | URL} path * @param {number} uid * @param {number} gid * @param {(err?: Error) => any} callback * @returns {void}

(path, uid, gid, callback)

Source from the content-addressed store, hash-verified

2475 * @returns {void}
2476 */
2477function lchown(path, uid, gid, callback) {
2478 callback = makeCallback(callback);
2479 path = getValidatedPath(path);
2480 validateInteger(uid, 'uid', -1, kMaxUserId);
2481 validateInteger(gid, 'gid', -1, kMaxUserId);
2482
2483 const h = vfsState.handlers;
2484 if (h !== null && vfsVoid(h.lchown(path, uid, gid), callback)) return;
2485
2486 const req = new FSReqCallback();
2487 req.oncomplete = callback;
2488 binding.lchown(path, uid, gid, req);
2489}
2490
2491/**
2492 * Synchronously sets the owner of the symbolic link.

Callers

nothing calls this directly

Calls 3

vfsVoidFunction · 0.85
lchownMethod · 0.80
makeCallbackFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…