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

method File.readBytes

Whole file as bytes.

Example:

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

fn main() io {
  let dir = fs.tempDir()!
  File.writeText("{dir}/b", "abc")!
  print("{File.readBytes("{dir}/b")!.len()}")
  fs.removeAll(dir)!
}
Вывод
3
pub(api) static fn readBytes(path: str) -> bytes | IoError  io

С версии. 1.0.0-beta

Параметры

ИмяТип
pathstr

Возвращает

bytes

Ошибки

Эффекты

io

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

См. также