OxL Справочник OxL
РусскийEnglish

method File.remove

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

Example:

oxl✓ проверяется в 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)!
}
Вывод
false
pub(api) static fn remove(path: str) -> () | IoError  io

С версии. 1.0.0-beta

Параметры

ИмяТип
pathstr

Возвращает

()

Ошибки

Эффекты

io

Определено в: std/io/io.oxl:386

См. также