Update io.rs

This commit is contained in:
Cutieguwu
2026-01-01 14:37:56 -05:00
parent 2df9e8e0f2
commit 9198193365

View File

@@ -20,10 +20,19 @@ pub fn get_stream_length<S: Seek>(stream: &mut S) -> io::Result<u64> {
len len
} }
/*
* IO Error Poisoning:
*
*
* Attempt 1:
*
* Wrap C calls w/ `ffi`. Most importantly, execute the `close()` through C.
*/
pub fn load_input() -> anyhow::Result<File> { pub fn load_input() -> anyhow::Result<File> {
OpenOptions::new() OpenOptions::new()
.read(true) .read(true)
.custom_flags(libc::O_DIRECT) //.custom_flags(libc::O_DIRECT)
.open(&CONFIG.input) .open(&CONFIG.input)
.with_context(|| format!("Failed to open input file: {}", &CONFIG.input.display())) .with_context(|| format!("Failed to open input file: {}", &CONFIG.input.display()))