Skip to main content

Mojo package

os

OS interface layer: environment, filesystem, process control.

The os package provides platform-independent access to operating system functionality including filesystem operations, environment variables, and process control. It offers portable interfaces to OS-dependent features, abstracting platform differences while exposing system-level capabilities. This package serves as the foundation for system programming in Mojo.

Use this package for system-level operations, filesystem management, environment configuration, or platform abstraction. For file I/O operations, use the built-in open() function. For path manipulation, see the os.path package for path functions or the pathlib package for the object-oriented Path type.

Packages

  • path: Provides a set of operating-system independent functions for manipulating file system paths.

Modules

  • atomic: Implements the Atomic struct.
  • env: Provides functions for working with environment variables.
  • fstat: Implements file system status operations.
  • os: Provides functions to access operating-system dependent functionality, including file system operations.
  • pathlike: Implements the PathLike trait.
  • process: Implements os methods for dealing with processes.

Was this page helpful?