Garry's Mod Wiki


file.Size( string fileName, string path )


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


1 string fileName
The file's name.
2 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.


Prints the size of helloworld.txt.

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

Page Links

Special Pages



Render Time: 33ms

Session 0
DB GetPage 3
Generate Html 6
SaveChanges 10
Render Body 0
Render Sidebar 12