Module fs/temp
fs/temp
RAII-managed temporary files and directories.
Example
{ TempDir } :: import "std/fs/temp";
main :: (fn(io : Io, exn : Exception) -> unit)({
dir := io.await(TempDir.new(io), { io, exn });
println(dir.path());
io.await(dir.remove(io), { io, exn });
});
Types
TempDir
object
TempDir
Temporary directory that can be cleaned up with remove.
Fields
| Name | Type | Description |
|---|---|---|
_path | Path | |
_removed | bool |
impl(TempDir, ...)
new_in : (TempDir) fn(parent : Path, io : Io) -> Impl(Future(TempDir, IoExn))new : (TempDir) fn(io : Io) -> Impl(Future(TempDir, IoExn))