IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

pathlib

Filesystem path manipulation and navigation.

The pathlib package provides object-oriented filesystem path handling with platform-independent path operations. It offers the Path type for representing and manipulating filesystem paths, along with utilities for path joining, expansion, and directory operations. This package makes working with file paths safer and more intuitive than manual string manipulation.

Use this package for any filesystem path operations including constructing paths, navigating directories, checking file existence, or performing path-related queries in a platform-independent way.

Modules

  • path: Path manipulation module.