method File.readBytes
Whole file as bytes.
Example:
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
Параметры
| Имя | Тип |
|---|---|
path | str |
Возвращает
bytes
Ошибки
IoError@error
Эффекты
io
Определено в: std/io/io.oxl:268