* Asynchronously changes the owner and group * of a file. * @param {string | Buffer | URL} path * @param {number} uid * @param {number} gid * @param {(err?: Error) => any} callback * @returns {void}
(path, uid, gid, callback)
| 2569 | * @returns {void} |
| 2570 | */ |
| 2571 | function chown(path, uid, gid, callback) { |
| 2572 | callback = makeCallback(callback); |
| 2573 | path = getValidatedPath(path); |
| 2574 | validateInteger(uid, 'uid', -1, kMaxUserId); |
| 2575 | validateInteger(gid, 'gid', -1, kMaxUserId); |
| 2576 | |
| 2577 | const h = vfsState.handlers; |
| 2578 | if (h !== null && vfsVoid(h.chown(path, uid, gid), callback)) return; |
| 2579 | |
| 2580 | const req = new FSReqCallback(); |
| 2581 | req.oncomplete = callback; |
| 2582 | binding.chown(path, uid, gid, req); |
| 2583 | } |
| 2584 | |
| 2585 | /** |
| 2586 | * Synchronously changes the owner and group |
nothing calls this directly
no test coverage detected