file.Exists
From GMod Wiki
| Function | |
| Syntax |
file.Exists( String filename, [ Boolean usebasefolder ] ) Where is this used? |
| Description: | |
| Checks for file existence | |
| Returns: | Boolean |
| Part of Library: | File |
| Realm: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=File.Exists]File.Exists [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
| Description | Checks if 'example.txt' exists in data/. |
|---|---|
| Used on | |
| Code | print(file.Exists("example.txt")) |
| Output | N/A |
| Description | Checks if 'example.txt' exists in the garrysmod base folder. |
|---|---|
| Used on | |
| Code | print(file.Exists("example.txt", true)) |
| Output | N/A |
Additional Notes
- Relative to garrysmod/data.
- If usebasefolder is true then it starts relative to the GMod base folder (garrysmod/garrysmod).