API Reference › Path › Path.dir
method

Path.dir

Path.dir(p) -> string

Returns everything before the last / — the containing directory. A path with no separator yields "." (the current directory); the root / stays /.

Parameters

pthe path

Example

program Dir {
  entry {
    if Path.dir("mods/foo/data.json") == "mods/foo" { print(1) }
  }
}
← All symbols