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

method File.appendBytes

Appends content, creating the file if needed.

Example:

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

fn main() io {
  let path = "/tmp/oxl_doc_ab.bin"
  File.writeBytes(path, b"ab")!
  File.appendBytes(path, b"cd")!
  print("{File.readBytes(path)!.len()}")
  File.remove(path)!
}
Вывод
4
pub(api) static fn appendBytes(path: str, content: bytes) -> () | IoError  io

Сложность. O(n) in the size of the content.

С версии. 1.0.0-beta

Параметры

ИмяТип
pathstr
contentbytes

Возвращает

()

Ошибки

  • IoError @error
  • `IoError` as for `writeBytes`.

Эффекты

io

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

См. также