Skip to main content

Module tempfile

Module tempfile 

Source
Expand description

Utility functions for creating temporary files and directories.

Most of these types wrap around the tempfile crate. We add two additional features:

  • There are wrappers around temporary directories and files that expose the dir/file as an object store path, std path, or string, which can save some boilerplate.
  • We work around a current bug in the url crate which fails to parse Windows paths like C:\ correctly. We do so by replacing all \ with / in the path. This is not safe in general (e.g. paths may use \ as an escape) but it should be safe for temporary paths.

Structsยง

TempDir
A temporary directory
TempFile
A temporary file
TempObjDir
A temporary directory that is exposed as an object store path
TempObjFile
A temporary file that is exposed as an object store path
TempStdDir
A temporary directory that is exposed as a standard library path
TempStdFile
A temporary file that is exposed as a standard library path
TempStdPath
Get a unique path to a temporary file
TempStrDir
A temporary directory that is exposed as a string