Difference between revisions of "Fs.exists"

From ComputerCraft Wiki
Jump to: navigation, search
(Copy description from API page, fix return styling, and use type template)
m
Line 4: Line 4:
 
|args={{Type|string}} path
 
|args={{Type|string}} path
 
|api=fs
 
|api=fs
|returns={{Type|boolean}} <code>true</code> if <var>path</var> is an existing file or directory, or <code>false</code> if not
+
|returns={{Type|boolean}} does the file or folder exists?
 
|desc=Checks if a path refers to an existing file or directory.
 
|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
 
}}
 
}}

Revision as of 16:25, 10 April 2014


Grid Redstone.png  Function fs.exists
Checks if a path refers to an existing file or directory.
Syntax fs.exists(string path)
Returns boolean does the file or folder exists?
Part of ComputerCraft
API fs

Examples

Grid paper.png  Example
Checks that the "rom" directory exists.
Code
print(fs.exists("rom"))
Output true