Chmod()
ts
Chmod(path: string, mode: number): respBase;Changes the POSIX file mode of the target file-system object pointed to by path.
WARNING
This method may or may not be supported depending on the file-system targeted by the VFS. Typically, only POSIX target file-systems support this.
Parameters
| Parameter | Type | Explanation |
|---|---|---|
path | string | The fully qualified root-based target path to the file/directory you wish to change the mode of |
mode | number | The integer representation of a POSIX file mode |
Returns a respBase object.
Example
ts
var vfs = GetCurrentVFS();
if (vfs != null) {
var resp = vfs.Chmod("/data/backup.zip", 0o644);
if (resp.Ok()) {
Log("File mode changed");
} else {
Log("Error: " + resp.ErrorMsg());
}
} else {
Log("VFS was null");
}