tape: pmt - implement options command

This commit is contained in:
Dietmar Maurer
2021-04-07 16:52:11 +02:00
parent 5d6379f8db
commit 80ea23e1b9
2 changed files with 67 additions and 1 deletions

View File

@ -109,11 +109,21 @@ impl LtoTapeHandle {
let block_length = Some(0); // variable length mode
let buffer_mode = Some(true); // Always use drive buffer
self.sg_tape.set_drive_options(compression, block_length, buffer_mode)?;
self.set_drive_options(compression, block_length, buffer_mode)?;
Ok(())
}
/// Set driver options
pub fn set_drive_options(
&mut self,
compression: Option<bool>,
block_length: Option<u32>,
buffer_mode: Option<bool>,
) -> Result<(), Error> {
self.sg_tape.set_drive_options(compression, block_length, buffer_mode)
}
/// Write a single EOF mark without flushing buffers
pub fn write_filemarks(&mut self, count: usize) -> Result<(), std::io::Error> {
self.sg_tape.write_filemarks(count, false)