Deno.chown
chown
-
chown(path: string, uid: number, gid: number): Promise<void>
-
更改常规文件或目录的所有者。该功能在 Windows 上不可用。
Change owner of a regular file or directory. This functionality is not available on Windows.
await Deno.chown("myFile.txt", 1000, 1002);
需要
allow-write
权限。Requires
allow-write
permission.如果在 Windows 上执行,将抛出错误(未实现)。
Throws Error (not implemented) if executed on Windows
参数
- ##### path: string
文件路径
path to the file
- ##### uid: number
user id (UID) of the new owner
文件新的所有者的用户 ID (UID)
- ##### gid: number
文件新的所有者的用户组 ID (GID)
group id (GID) of the new owner