Garry's Mod Wiki

file.IsDir

  boolean file.IsDir( string fileName, string gamePath )

Description

Returns whether the given file is a directory or not.

Arguments

1 string fileName
The file or directory's name.
2 string gamePath
The path to look for the files and directories in. See this list for a list of valid paths.

Returns

1 boolean
true if the given path is a directory or false if it's a file.

Example

Prints if helloworld.txt is a directory.

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