renamefile
Moves a workspace file to a new path.
Syntax
renamefile(from: string, to: string) -> ()
movefile(from: string, to: string) -> ()
Also available as
movefile
Parameters
| Parameter | Type | Description |
|---|---|---|
from | string | Workspace-relative file to move. |
to | string | Workspace-relative destination. |
Description
The file is written to the destination and then removed from the old path. The destination must not already exist, and writing it follows the same rules as writefile, including the blocked program extensions. If the destination cannot be written the original file stays where it was.
Example
writefile("old-name.txt", "hello")
renamefile("old-name.txt", "new-name.txt")
print(isfile("old-name.txt"), readfile("new-name.txt"))
delfile("new-name.txt")
These are Game executor contracts. Check build requirements and session lifetimes before using them.
