fs.isDir

From ComputerCraft
Jump to: navigation, search

fs.isDir
Function
Syntax
fs.isDir()
Returns boolean
API fs
Source CC:Tweaked (source)

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

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