method File.writeBytesSync
Like writeBytes, and fsyncs the file before returning (durable).
Example:
use std.io { File }
fn main() io {
let path = "/tmp/oxl_doc_wbs.bin"
File.writeBytesSync(path, b"durable")!
print("{File.readBytes(path)!.len()}")
File.remove(path)!
}Вывод
7
pub(api) static fn writeBytesSync(path: str, content: bytes) -> () | IoError ioСложность. O(n) plus the cost of the `fsync`.
С версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
path | str |
content | bytes |
Возвращает
()
Ошибки
IoError@error- `IoError` as for `writeBytes`.
Эффекты
io
Определено в: std/io/io.oxl:323