OxL Reference

method fs.createDir

Creates one directory; fails with AlreadyExists if it exists and with NotFound if the parent is missing.

Example:

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

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

Since. 1.0.0-beta

Parameters

NameType
pathstr

Returns

()

Errors

Effects

io

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

See also