tape: return current_file_number as u64
This commit is contained in:
parent
3e2984bcb9
commit
26aa9aca40
|
@ -308,7 +308,7 @@ impl TapeDriver for LinuxTapeHandle {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn current_file_number(&mut self) -> Result<usize, Error> {
|
fn current_file_number(&mut self) -> Result<u64, Error> {
|
||||||
let mut status = mtget::default();
|
let mut status = mtget::default();
|
||||||
|
|
||||||
self.mtnop()?;
|
self.mtnop()?;
|
||||||
|
@ -320,7 +320,7 @@ impl TapeDriver for LinuxTapeHandle {
|
||||||
if status.mt_fileno < 0 {
|
if status.mt_fileno < 0 {
|
||||||
bail!("current_file_number failed (got {})", status.mt_fileno);
|
bail!("current_file_number failed (got {})", status.mt_fileno);
|
||||||
}
|
}
|
||||||
Ok(status.mt_fileno as usize)
|
Ok(status.mt_fileno as u64)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn erase_media(&mut self, fast: bool) -> Result<(), Error> {
|
fn erase_media(&mut self, fast: bool) -> Result<(), Error> {
|
||||||
|
|
|
@ -49,7 +49,7 @@ pub trait TapeDriver {
|
||||||
fn move_to_eom(&mut self) -> Result<(), Error>;
|
fn move_to_eom(&mut self) -> Result<(), Error>;
|
||||||
|
|
||||||
/// Current file number
|
/// Current file number
|
||||||
fn current_file_number(&mut self) -> Result<usize, Error>;
|
fn current_file_number(&mut self) -> Result<u64, Error>;
|
||||||
|
|
||||||
/// Completely erase the media
|
/// Completely erase the media
|
||||||
fn erase_media(&mut self, fast: bool) -> Result<(), Error>;
|
fn erase_media(&mut self, fast: bool) -> Result<(), Error>;
|
||||||
|
|
|
@ -167,12 +167,12 @@ impl TapeDriver for VirtualTapeHandle {
|
||||||
Ok(()) // do nothing for now
|
Ok(()) // do nothing for now
|
||||||
}
|
}
|
||||||
|
|
||||||
fn current_file_number(&mut self) -> Result<usize, Error> {
|
fn current_file_number(&mut self) -> Result<u64, Error> {
|
||||||
let status = self.load_status()
|
let status = self.load_status()
|
||||||
.map_err(|err| format_err!("current_file_number failed: {}", err.to_string()))?;
|
.map_err(|err| format_err!("current_file_number failed: {}", err.to_string()))?;
|
||||||
|
|
||||||
match status.current_tape {
|
match status.current_tape {
|
||||||
Some(VirtualTapeStatus { pos, .. }) => { Ok(pos)},
|
Some(VirtualTapeStatus { pos, .. }) => { Ok(pos as u64)},
|
||||||
None => bail!("current_file_number failed: drive is empty (no tape loaded)."),
|
None => bail!("current_file_number failed: drive is empty (no tape loaded)."),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue