Chown()
ts
Chown(path: string, uid: number, gid: number): respBase;Changes the owner user and group IDs on an object (file or directory) in the target file system.
WARNING
This method may or may not be supported depending on the file-system targeted by the VFS.
Parameters
| Parameter | Type | Explanation |
|---|---|---|
path | string | The fully qualified root-based target path to the file/directory you wish to change ownership of |
uid | number | The OS-issued, numerical UID (user ID) of the new owner |
gid | number | The OS-issued, numerical GID (group ID) of the new owner's group |
Returns a respBase object.
Example
ts
var vfs = GetCurrentVFS();
if (vfs != null) {
var resp = vfs.Chown("/data/backup.zip", 1000, 1000);
if (resp.Ok()) {
Log("Ownership changed");
} else {
Log("Error: " + resp.ErrorMsg());
}
} else {
Log("VFS was null");
}