Skip to main content

Mojo module

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

Was this page helpful?