API Reference › Fs › Fs.is_dir
method

Fs.is_dir

Fs.is_dir(p) -> bool

Returns whether the path exists and is a directory (as opposed to a file). Useful when walking a tree or deciding whether to recurse.

Parameters

pthe path to test

Example

program IsDir {
  entry {
    if Fs.is_dir("mods") { print(1) } else { print(0) }
  }
}
← All symbols