getfilesize
Returns the size of a workspace file.
Syntax
getfilesize(path: string) -> number
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Workspace-relative file. |
Returns
| Type | Description |
|---|---|
number | The file's size in bytes. |
Description
The file is read the way readfile reads it, so the same path rules and errors apply, and a missing file raises an error.
Example
writefile("size-example.txt", "hello")
print(getfilesize("size-example.txt"))
delfile("size-example.txt")
These are Game executor contracts. Check build requirements and session lifetimes before using them.
