Garry's Mod Wiki


boolean file.Exists( string name, string path )


Returns a boolean of whether the file or directory exists or not.


1 string name
The file or directory's name.
2 string path
The path of where to look for the file.

  • "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.


1 boolean
Returns true if the file exists and false if it does not.


Prints whether the data folder exists in the base directory.

print( file.Exists("data", "GAME") )
Output: true

Page Links

Special Pages



Render Time: 29ms

DB GetPage 3
Generate Html 4
SaveChanges (1) 8
Render Body 0
Render Sidebar 11