temp-dir
Provides a TempDir
struct.
Features
- Makes a directory in a system temporary directory
- Recursively deletes the directory and its contents on drop
- Optional name prefix
- No dependencies
forbid(unsafe_code)
Limitations
- Not security-hardened.
Alternatives
test_dir
- Has a handy
TestDir
struct - Incomplete documentation
temp_testdir
- Incomplete documentation
mktemp
- Sets directory mode 0700 on unix
- Contains
unsafe
- No readme or online docs
Related Crates
Example
use TempDir;
let d = new.unwrap;
// Prints "/tmp/t1a9b0".
println!;
let f = d.child;
// Prints "/tmp/t1a9b0/file1".
println!;
write.unwrap;
assert_eq!;
// Prints "/tmp/t1a9b1".
println!;
Cargo Geiger Safety Report
Metric output format: x/y
x = unsafe code used by the build
y = total unsafe code found in the crate
Symbols:
🔒 = No `unsafe` usage found, declares #![forbid(unsafe_code)]
❓ = No `unsafe` usage found, missing #![forbid(unsafe_code)]
☢️ = `unsafe` usage found
Functions Expressions Impls Traits Methods Dependency
0/0 0/0 0/0 0/0 0/0 🔒 temp-dir 0.1.0
0/0 0/0 0/0 0/0 0/0