OxL Reference

method fs.tempDir

A new empty private directory below $TMPDIR (default /tmp) named prefixXXXXXX; the caller removes it.

Example:

oxl✓ checked in CI
use std.io { File, fs }

fn main() io {
  let dir = fs.tempDir("demo-")!
  print("{File.isDir(dir)}")
  fs.removeAll(dir)!
}
Output
true
pub(api) static fn tempDir(prefix: str = "oxl-") -> str | IoError  io

Since. 1.0.0-beta

Parameters

NameType
prefixstr = "oxl-"

Returns

str

Errors

Effects

io

Defined in: std/io/io.oxl:790

See also