Expand description
Support for easy creation of temporary files and directories inside a
Utf8TempDir
.
Creation of files inside temporary directories, especially ones inside subdirectories, can be a bit bothersome to do by hand. This module provides convenient ways to create these files.
§Examples
use camino_tempfile_ext::prelude::*;
// Create a temporary directory.
let dir = Utf8TempDir::new().unwrap();
// Create a nested file within this directory. Creation of intermediate
// directories is automatic.
let file = dir.child("foo/bar/baz.txt");
file.write_str("Hello, world!").unwrap();
// Now do something with the file...
Structs§
- Child
Path - A path within a temporary directory.
- Fixture
Error - Failure when initializing the fixture.
Enums§
- Fixture
Kind - Fixture initialization cause.
Traits§
- File
Touch - Create empty files at
ChildPath
. - File
Write Bin - Write a binary file at
ChildPath
. - File
Write File - Write (copy) a file to
ChildPath
. - File
Write Str - Write a text file at a
ChildPath
orNamedUtf8TempFile
. - Path
Child - Access paths within a
Utf8TempDir
for testing. - Path
Copy - Copy files into
Utf8TempDir
. - Path
Create Dir - Create empty directories at
ChildPath
. - Symlink
ToDir - Create a symlink to a target directory.
- Symlink
ToFile - Create a symlink to a target file.