src/pxar/decoder.rs: make read_directory_entry usable by fuse

... and thereby allow it to read a single directory entry based on the
start and end archive offsets.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
Christian Ebner 2019-09-09 18:27:23 +02:00 committed by Dietmar Maurer
parent 3f7f4f34be
commit ac12570e99

View File

@ -75,7 +75,11 @@ impl<R: Read + Seek, F: Fn(&Path) -> Result<(), Error>> Decoder<R, F> {
Ok(())
}
fn read_directory_entry(&mut self, start: u64, end: u64) -> Result<DirectoryEntry, Error> {
pub(crate) fn read_directory_entry(
&mut self,
start: u64,
end: u64,
) -> Result<DirectoryEntry, Error> {
self.seek(SeekFrom::Start(start))?;
let head: PxarHeader = self.inner.read_item()?;