Chtimes()
ts
Chtimes(path: string, atime: number, mtime: number): respBase;Changes the last-access and last-modification timestamps 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. Some cloud-based object storages do not support this by design.
Parameters
| Parameter | Type | Explanation |
|---|---|---|
path | string | The fully qualified root-based target path to the file/directory you wish to change the timestamps for |
atime | number | Last-access time in UNIX-time standard integer notation |
mtime | number | Last-modification time in UNIX-time standard integer notation |
Returns a respBase object.
Example
ts
var vfs = GetCurrentVFS();
if (vfs != null) {
var resp = vfs.Chtimes("/data/backup.zip", 1731499386, 1731499386);
if (resp.Ok()) {
Log("File timestamps changed");
} else {
Log("Error: " + resp.ErrorMsg());
}
} else {
Log("VFS was null");
}