| Extracted from Pike v7.8 release 866 at 2018-07-18.

[Top]
MasterObject

# Method MasterObject()->dirname()

Method dirname

  `string dirname(string x)`

Description

  Returns all but the last segment of a path. Some example inputs and outputs:

  Expression | Value
  dirname("/a/b") | "/a"
  dirname("/a/") | "/a"
  dirname("/a") | "/"
  dirname("/") | "/"
  dirname("") | ""

See also

  basename() , explode_path()