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

method File.appendText

Appends text, creating the file if needed.

Example:

oxl✓ проверяется в CI
use std.io { File, fs }

fn main() io {
  let dir = fs.tempDir()!
  File.appendText("{dir}/log", "a")!
  File.appendText("{dir}/log", "b")!
  print(File.readText("{dir}/log")!)
  fs.removeAll(dir)!
}
Вывод
ab
pub(api) static fn appendText(path: str, text: str) -> () | IoError  io

С версии. 1.0.0-beta

Параметры

ИмяТип
pathstr
textstr

Возвращает

()

Ошибки

Эффекты

io

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

См. также