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

Function fchmod

lib/fs.js:2344–2359  ·  view source on GitHub ↗

* Sets the permissions on the file. * @param {number} fd * @param {string | number} mode * @param {(err?: Error) => any} callback * @returns {void}

(fd, mode, callback)

Source from the content-addressed store, hash-verified

2342 * @returns {void}
2343 */
2344function fchmod(fd, mode, callback) {
2345 mode = parseFileMode(mode, 'mode');
2346 callback = makeCallback(callback);
2347
2348 const h = vfsState.handlers;
2349 if (h !== null && vfsVoid(h.fchmod(fd), callback)) return;
2350
2351 if (permission.isEnabled()) {
2352 callback(new ERR_ACCESS_DENIED('fchmod API is disabled when Permission Model is enabled.'));
2353 return;
2354 }
2355
2356 const req = new FSReqCallback();
2357 req.oncomplete = callback;
2358 binding.fchmod(fd, mode, req);
2359}
2360
2361/**
2362 * Synchronously sets the permissions on the file.

Callers

nothing calls this directly

Calls 5

parseFileModeFunction · 0.85
vfsVoidFunction · 0.85
isEnabledMethod · 0.80
makeCallbackFunction · 0.70
callbackFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…