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)!
}Output
7
pub(api) static fn writeBytesSync(path: str, content: bytes) -> () | IoError ioComplexity. O(n) plus the cost of the `fsync`.
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
path | str |
content | bytes |
Returns
()
Errors
IoError@error- `IoError` as for `writeBytes`.
Effects
io
Defined in: std/io/io.oxl:317