* 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)
| 2435 | * @returns {void} |
| 2436 | */ |
| 2437 | function 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. |
nothing calls this directly
no test coverage detected