dirname
ErrorsCollection

dirname

Synthesised documentation from type/IO/Path

From type/IO/Path

See Original text in context

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 basename. 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: «/␤»