file.Exists

From GMod Wiki

Jump to: navigation, search
Function
Syntax file.Exists( String filename, [ Boolean usebasefolder ] )
Where is this used?
Description:
Checks for file existence
Returns: Boolean
Part of Library: File
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=File.Exists]File.Exists [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionChecks if 'example.txt' exists in data/.
Used onNewerShared.png
Code
print(file.Exists("example.txt"))
OutputN/A

DescriptionChecks if 'example.txt' exists in the garrysmod base folder.
Used onNewerShared.png
Code
print(file.Exists("example.txt", true))
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox