fs.isDir

Returns true if a directory exists at path path. Returns false if path path is a file, or if it does not exist.

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

fs.isDir
Function
Syntax
fs.isDir(
  • 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.