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)!
}Вывод
false
pub(api) static fn remove(path: str) -> () | IoError ioС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
path | str |
Возвращает
()
Ошибки
IoError@error
Эффекты
io
Определено в: std/io/io.oxl:386