fs.exists

Returns true if a file or directory exists at path path, otherwise returns false.

ExampleCheck if directory exists
Creates the directory foo, checking if it exists before and after.
Code
<nowiki>
print("Foo exists:", fs.exists("foo"))
print("Making foo")
fs.makeDir("foo")
print("Foo exists:", fs.exists("foo"))
    </nowiki>
Output
<nowiki>
Foo exists: false
Making foo
Foo exists: true
</nowiki>

fs.exists
Function
Syntax
fs.exists(
  • path : string
)

Returns boolean
API fs
Source CC:Tweaked (source)
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.