Garry's Mod Wiki

file.IsDir

boolean file.IsDir( string fileName, string path )

Description

Returns whether the given file is a directory or not.

Arguments

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.

Returns

1 boolean
True if the given path is a directory or false if it is a file.

Example

Prints if helloworld.txt is a directory.

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

Page Links


Special Pages


Wikis

?

Render Time: 24ms

DB GetPage 3
Generate Html 6
SaveChanges (1) 7
Render Body 0
Render Sidebar 6