File systemReference
getfilesize
Get the size of a workspace file in bytes.
Details#
Get the size of a workspace file in bytes. File size in bytes as a Luau number. Missing files, folders and open/stat failures cause an error.
Signature#
getfilesize(path: string): numberParameters#
| Parameter | Type | Description |
|---|---|---|
path | string | UTF-8 path relative to the application's workspace. |
Returns#
File size in bytes as a Luau number. Missing files, folders and open/stat failures cause an error.
Examples#
Local example
writefile("docs-example/size.txt", "hello")
print(getfilesize("docs-example/size.txt")) -- 5