file.Size

From Garry's Mod
Jump to: navigation, search
 file.Size( )

Contents

Description

Returns the file's size in bytes. If the file is not found, returns -1.

Arguments

string fileName

The file's name.

Arguments

string path

The path type.

  • "GAME" Structured like base folder (garrysmod/), searches all the mounted content (main folder, addons, mounted games etc)
  • "LUA" or "lsv" - All Lua folders (lua/) including gamesmodes and addons
  • "DATA" Data folder (garrysmod/data)
  • "MOD" Strictly the game folder (garrysmod/), ignores mounting.

Examples

Example

Prints the size of helloworld.txt.

print( file.Size("helloworld.txt", "DATA") )

Output:

8
Personal tools
Navigation