* Sets the permissions on the file. * @param {number} fd * @param {string | number} mode * @param {(err?: Error) => any} callback * @returns {void}
(fd, mode, callback)
| 2342 | * @returns {void} |
| 2343 | */ |
| 2344 | function 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. |
nothing calls this directly
no test coverage detected
searching dependent graphs…