Registry / utility / tempfile

tempfile

JSON →
library3.27.0rscratesunverified

A library for managing temporary files and directories.

# Cargo.toml [dependencies] tempfile = "3.27.0"
INSTALL
IMPORT
SIG · TEMPFILE
T
tempfile
utilityrustv3.27.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TempDir
use tempfile::TempDir;

Creates a temporary directory and writes a file inside it.

use tempfile::TempDir; use std::fs::File; use std::io::Write; fn main() -> std::io::Result<()> { let dir = TempDir::new()?; let file_path = dir.path().join("test.txt"); let mut file = File::create(&file_path)?; writeln!(file, "Hello, world!")?; println!("Created temp file: {:?}", file_path); Ok(()) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
3.27.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
tempfile — cargo add tempfile · libregistry