chownSync
import { chownSync } from "jsr:@ende/fs/unstable-chown";function · experimental · requires --allow-write
function chownSync(path: string | URL, uid: number | null, gid: number | null): voidSynchronously change owner of a regular file or directory.
This functionality is not available on Windows.
Requires allow-write permission.
Throws Error (not implemented) if executed on Windows.
path: string | URLThe path to the file/directory.
uid: number | nullThe user id (UID) of the new owner, or
nullfor no change.gid: number | nullThe group id (GID) of the new owner, or
nullfor no change.
Example: Usage
import { chownSync } from "@ende/fs/unstable-chown";
chownSync("README.md", 1000, 1002);