* Synchronously changes the owner and group * of a file. * @param {string | Buffer | URL} path * @param {number} uid * @param {number} gid * @returns {void}
(path, uid, gid)
| 2591 | * @returns {void} |
| 2592 | */ |
| 2593 | function chownSync(path, uid, gid) { |
| 2594 | path = getValidatedPath(path); |
| 2595 | validateInteger(uid, 'uid', -1, kMaxUserId); |
| 2596 | validateInteger(gid, 'gid', -1, kMaxUserId); |
| 2597 | |
| 2598 | const h = vfsState.handlers; |
| 2599 | if (h !== null) { |
| 2600 | const result = h.chownSync(path, uid, gid); |
| 2601 | if (result !== undefined) return; |
| 2602 | } |
| 2603 | |
| 2604 | binding.chown(path, uid, gid); |
| 2605 | } |
| 2606 | |
| 2607 | /** |
| 2608 | * Changes the file system timestamps of the object |