OxL Reference

method fs.removeDir

Removes an empty directory.

Example:

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

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

Since. 1.0.0-beta

Parameters

NameType
pathstr

Returns

()

Errors

Effects

io

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

See also