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

Function chmod

lib/fs.js:2437–2448  ·  view source on GitHub ↗

* Asynchronously changes the permissions of a file. * @param {string | Buffer | URL} path * @param {string | number} mode * @param {(err?: Error) => any} callback * @returns {void}

(path, mode, callback)

Source from the content-addressed store, hash-verified

2435 * @returns {void}
2436 */
2437function chmod(path, mode, callback) {
2438 path = getValidatedPath(path);
2439 mode = parseFileMode(mode, 'mode');
2440 callback = makeCallback(callback);
2441
2442 const h = vfsState.handlers;
2443 if (h !== null && vfsVoid(h.chmod(path, mode), callback)) return;
2444
2445 const req = new FSReqCallback();
2446 req.oncomplete = callback;
2447 binding.chmod(path, mode, req);
2448}
2449
2450/**
2451 * Synchronously changes the permissions of a file.

Callers

nothing calls this directly

Calls 4

parseFileModeFunction · 0.85
vfsVoidFunction · 0.85
makeCallbackFunction · 0.70
chmodMethod · 0.45

Tested by

no test coverage detected