Skip to main content
Log in

Mojo function

dirname

dirname[PathLike: PathLike, //](path: PathLike) -> String

Returns the directory component of a pathname.

Parameters:

  • PathLike (PathLike): The type conforming to the os.PathLike trait.

Args:

  • path (PathLike): The path to a file.

Returns:

The directory component of a pathname.

Was this page helpful?