method dirname

Documentation for method dirname assembled from the following types:

class IO::Path

From IO::Path

(IO::Path) method dirname

Defined as:

method dirname(IO::Path:D:)

Returns the directory name portion of the path object. That is, it returns the path excluding the volume and the base name. Unless the dirname consist of only the directory separator (i.e. it's the top directory), the trailing directory separator will not be included in the return value.

say IO::Path.new("/home/camelia/myfile.p6").dirname# OUTPUT: «/home/camelia␤» 
say IO::Path::Win32.new("C:/home/camelia").dirname;  # OUTPUT: «/home␤» 
say IO::Path.new("/home").dirname;                   # OUTPUT: «/␤»