Garry's Mod Wiki

file.Size

  number file.Size( string fileName, string gamePath )

Description

Returns the file's size in bytes.

Arguments

1 string fileName
The file's name.
2 string gamePath
The path to look for the files and directories in. See this list for a list of valid paths.

Returns

1 number
The file size in bytes, or -1 if the file is not found.

Example

Prints the size of helloworld.txt.

print( file.Size("helloworld.txt", "DATA") )
Output: 8