2 releases
Uses old Rust 2015
0.1.1 | Jul 15, 2017 |
---|---|
0.1.0 | Jul 13, 2017 |
#8 in #reading-file
65 downloads per month
Used in 3 crates
(via pre-rfc3243-libtw2-common)
7KB
file_offset
provides a platform-independent way of atomically reading and
writing files at specified offsets.
use file_offset::FileExt;
use std::fs::File;
use std::str;
let mut buffer = [0; 2048];
let f = File::open("src/lib.rs").unwrap();
f.read_offset(&mut buffer, 3);
print!("{}", str::from_utf8(&buffer).unwrap());