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

tempfile

Manage temporary files and directories: create, locate, and cleanup.

The tempfile package provides utilities for creating and managing temporary files and directories. It handles platform-specific temporary storage locations and ensures proper cleanup of temporary resources. Temporary files are useful for intermediate data, testing, and operations that need scratch space without polluting permanent storage.

Use this package when you need scratch space for intermediate computations, temporary storage during testing, or any operation requiring files that shouldn't persist after program execution.

Modules