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)!
}Output
ab
pub(api) static fn appendText(path: str, text: str) -> () | IoError ioSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
path | str |
text | str |
Returns
()
Errors
IoError@error
Effects
io
Defined in: std/io/io.oxl:339