* Synchronously changes the permissions on a symbolic link. * @param {string | Buffer | URL} path * @param {number} mode * @returns {void}
(path, mode)
| 2416 | * @returns {void} |
| 2417 | */ |
| 2418 | function lchmodSync(path, mode) { |
| 2419 | const fd = fs.openSync(path, O_WRONLY | O_SYMLINK); |
| 2420 | |
| 2421 | // Prefer to return the chmod error, if one occurs, |
| 2422 | // but still try to close, and report closing errors if they occur. |
| 2423 | try { |
| 2424 | fs.fchmodSync(fd, mode); |
| 2425 | } finally { |
| 2426 | fs.closeSync(fd); |
| 2427 | } |
| 2428 | } |
| 2429 | |
| 2430 | /** |
| 2431 | * Asynchronously changes the permissions of a file. |