method File.appendText
Appends text, creating the file if needed.
Example:
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
Параметры
| Имя | Тип |
|---|---|
path | str |
text | str |
Возвращает
()
Ошибки
IoError@error
Эффекты
io
Определено в: std/io/io.oxl:339