OxL Reference

method File.remove

Deletes a file or a symbolic link (not a directory: see fs.removeDir).

Example:

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

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

Since. 1.0.0-beta

Parameters

NameType
pathstr

Returns

()

Errors

Effects

io

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

See also