Difference between revisions of "Fs.exists"
From ComputerCraft Wiki
(Create page) |
MKlegoman357 (Talk | contribs) |
||
| (4 intermediate revisions by 3 users not shown) | |||
| Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=fs.exists | |name=fs.exists | ||
| − | |args= | + | |args={{Type|string}} path |
|api=fs | |api=fs | ||
| − | |returns= | + | |returns={{Type|boolean}} does the file or folder exist? |
| − | |desc=Checks | + | |desc=Checks if a path refers to an existing file or directory. |
|examples= | |examples= | ||
{{Example | {{Example | ||
| − | |desc=Checks that the "rom" directory exists | + | |desc=Checks that the "rom" directory exists. |
| − | |code=print(fs.exists("rom")) | + | |code=print('''fs.exists("rom")''') |
|output=true | |output=true | ||
}} | }} | ||
}} | }} | ||
| + | |||
| + | [[Category:Lua_Core_Functions]] | ||
Latest revision as of 16:25, 10 April 2014
| Checks if a path refers to an existing file or directory. | |
| Syntax | fs.exists(string path) |
| Returns | boolean does the file or folder exist? |
| Part of | ComputerCraft |
| API | fs |
Examples
| Checks that the "rom" directory exists. | |
| Code |
print(fs.exists("rom"))
|
| Output | true |