Garry's Mod Wiki

file.Size

file.Size( string fileName, string path )

Description

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

Arguments

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.

Example

Prints the size of helloworld.txt.

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

Page Links


Special Pages


Wikis

?

Render Time: 36ms

DB GetPage 3
Generate Html 3
SaveChanges (1) 17
Render Body 0
Render Sidebar 10