Update io.rs
This commit is contained in:
11
src/io.rs
11
src/io.rs
@@ -20,10 +20,19 @@ pub fn get_stream_length<S: Seek>(stream: &mut S) -> io::Result<u64> {
|
||||
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> {
|
||||
OpenOptions::new()
|
||||
.read(true)
|
||||
.custom_flags(libc::O_DIRECT)
|
||||
//.custom_flags(libc::O_DIRECT)
|
||||
.open(&CONFIG.input)
|
||||
.with_context(|| format!("Failed to open input file: {}", &CONFIG.input.display()))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user