method File.remove
Deletes a file or a symbolic link (not a directory: see fs.removeDir).
Example:
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 ioSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
path | str |
Returns
()
Errors
IoError@error
Effects
io
Defined in: std/io/io.oxl:392