method to write header to a path
This commit is contained in:
parent
322fa97f6a
commit
d23e488aaa
@ -1,5 +1,5 @@
|
||||
use std::cell::RefCell;
|
||||
use std::fs::File;
|
||||
use std::fs::{File,OpenOptions};
|
||||
use std::io::{Read, Write};
|
||||
use std::path::Path;
|
||||
|
||||
@ -245,6 +245,10 @@ impl ImageHeader {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn write_header_to<P: AsRef<Path>>(&self, path: P) -> Result<()> {
|
||||
self.write_header(OpenOptions::new().write(true).open(path.as_ref())?)
|
||||
}
|
||||
|
||||
pub fn clear(&self) {
|
||||
for b in &mut self.0.borrow_mut()[..] {
|
||||
*b = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user