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"/home/camelia/myfile.p6").dirname# OUTPUT: «/home/camelia␤» 
say"C:/home/camelia").dirname;  # OUTPUT: «/home␤» 
say"/home").dirname;                   # OUTPUT: «/␤»