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).

path

Path manipulation module.

This module defines a platform-independent API for working with filesystem paths. Path, its core type, represents a filesystem path. It exposes operations such as path composition, existence checks, file I/O, and access to file attributes.

To use these features import the Path type from this module.

Example:

from std.pathlib import Path
var p = Path("a") / "b" / "c.txt"
print(p) # a/b/c.txt

comptime values

DIR_SEPARATOR

comptime DIR_SEPARATOR = "/"

The directory separator character for path operations.

Structs

Functions

  • cwd: Gets the current directory.