src/backup/catalog.rs - CatalogReader::dump(): use root()
This commit is contained in:
parent
8f24a9ea18
commit
2ec208aef5
|
@ -381,14 +381,17 @@ impl <R: Read + Seek> CatalogReader<R> {
|
||||||
Self { reader }
|
Self { reader }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Print catalog to stdout
|
||||||
pub fn dump(&mut self) -> Result<(), Error> {
|
pub fn dump(&mut self) -> Result<(), Error> {
|
||||||
|
|
||||||
self.reader.seek(SeekFrom::End(-8))?;
|
let root = self.root()?;
|
||||||
|
match root {
|
||||||
let start = unsafe { self.reader.read_le_value::<u64>()? };
|
DirEntry { attr: DirEntryAttribute::Directory { start }, .. }=> {
|
||||||
|
|
||||||
self.dump_dir(std::path::Path::new("./"), start)
|
self.dump_dir(std::path::Path::new("./"), start)
|
||||||
}
|
}
|
||||||
|
_ => unreachable!(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Get the root DirEntry
|
/// Get the root DirEntry
|
||||||
pub fn root(&mut self) -> Result<DirEntry, Error> {
|
pub fn root(&mut self) -> Result<DirEntry, Error> {
|
||||||
|
|
Loading…
Reference in New Issue