Difference between revisions of "Fs.exists"

From ComputerCraft Wiki
Jump to: navigation, search
m (Corrected mapping from "Boolean" to "Boolean (type)")
(Copy description from API page, fix return styling, and use type template)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=fs.exists
 
|name=fs.exists
|args=[[string (type)|string]] path
+
|args={{Type|string}} path
 
|api=fs
 
|api=fs
|returns=[[boolean_(type)|boolean]] <code>true</code> if <var>path</var> is an existing file or directory, or <var>false</var> if not
+
|returns={{Type|boolean}} <code>true</code> if <var>path</var> is an existing file or directory, or <code>false</code> if not
|desc=Checks whether a file or directory exists
+
|desc=Checks if a path refers to an existing file or directory.
 
|examples=
 
|examples=
 
{{Example
 
{{Example

Revision as of 19:43, 22 April 2013


Grid Redstone.png  Function fs.exists
Checks if a path refers to an existing file or directory.
Syntax fs.exists(string path)
Returns boolean true if path is an existing file or directory, or false if not
Part of ComputerCraft
API fs

Examples

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