diff --git a/src/backup/catalog.rs b/src/backup/catalog.rs index 9e2fa137..84b0d285 100644 --- a/src/backup/catalog.rs +++ b/src/backup/catalog.rs @@ -381,13 +381,16 @@ impl CatalogReader { Self { reader } } + /// Print catalog to stdout pub fn dump(&mut self) -> Result<(), Error> { - self.reader.seek(SeekFrom::End(-8))?; - - let start = unsafe { self.reader.read_le_value::()? }; - - self.dump_dir(std::path::Path::new("./"), start) + let root = self.root()?; + match root { + DirEntry { attr: DirEntryAttribute::Directory { start }, .. }=> { + self.dump_dir(std::path::Path::new("./"), start) + } + _ => unreachable!(), + } } /// Get the root DirEntry