Garry's Mod Wiki

file.Exists

  boolean file.Exists( string name, string gamePath )

Description

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

Arguments

1 string name
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
Returns true if the file exists and false if it does not.

Example

Prints whether the data folder exists in the base directory.

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