Garry's Mod Wiki


boolean file.IsDir( string fileName, string path )


Returns whether the given file is a directory or not.


1 string fileName
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
True if the given path is a directory or false if it is a file.


Prints if helloworld.txt is a directory.

print( file.IsDir("helloworld.txt", "DATA") )
Output: false

Page Links

Special Pages



Render Time: 34ms

DB GetPage 6
Generate Html 4
SaveChanges (1) 9
Render Body 0
Render Sidebar 12