Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArchiveFileModel does not expose file metadata #13

Open
weltkante opened this issue Dec 29, 2015 · 3 comments
Open

ArchiveFileModel does not expose file metadata #13

weltkante opened this issue Dec 29, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@weltkante
Copy link
Owner

As mentioned in issue #12 the current implementation of ArchiveFileModelMetadataReader is incomplete. It stores the file metadata while reading it but does not build the corresponding ArchiveFileModel to expose it.

@weltkante weltkante added the bug label Dec 29, 2015
@weltkante weltkante self-assigned this Dec 29, 2015
@weltkante
Copy link
Owner Author

Updated the nuget package to include a prototype for the ArchiveFileModel implementation. The mapping between streams and files may need improvement.

@weltkante
Copy link
Owner Author

The current concept for the ArchiveFileModel builds a tree of folders and files to allow hierarchical display/navigation. The concept was missing a mapping between file metadata and their streams and relied on the caller doing the counting to associate streams with files.

I've added a simple index-based mapping on the ArchiveFileModel to map from stream to file metadata, and I've extended the ArchivedFile class to store the stream index.

It is still unclear how to expose the advanced features of the 7z format (in particular deletion markers). In the current implementation deletion markers are not exposed but they are resolved internally in case the file is added and then deleted in the same archive (but I think this is a corner case which is not expected from normal archives, since archives are not updated incrementally but always rebuilt from scratch, so a filename would normally only appear once).

While going through the ArchiveFileModel I also noticed the offset metadata was not included in the previous API. I've added it for now, but I don't exactly remember what it meant. I think it was related to sparse files and meant that the compressed content should be placed in the middle of the file instead of at the beginning. Further research in the original sourcecode is required to determine the usage of that offset metadata field.

@weltkante weltkante added this to the nuget-release milestone Dec 29, 2015
@weltkante
Copy link
Owner Author

The file metadata should also be exposed as a flat list so one can iterate over all files without having to traverse the hierarchy. This is required to properly extract all files, not just those with content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant