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

[Question] Multi-volume rar streaming #776

Open
Xodaru opened this issue Nov 1, 2023 · 3 comments
Open

[Question] Multi-volume rar streaming #776

Xodaru opened this issue Nov 1, 2023 · 3 comments
Labels

Comments

@Xodaru
Copy link

Xodaru commented Nov 1, 2023

In a presentation you did at Dot Net Sheff back in 2018 you mentioned one of the use cases of SharpCompress was to mount ISOs as an image when they are spanned across multiple RAR files.

I am trying to wrap my head around this to do something similar but struggling to read a file that spans multiple rar files.
Do you have an example on how this was achieved?

Part of the problem I have is the stream is not seek'able as with my use case I know exactly what offset of the file I want to start extracting from. I can only send data when its requested, not in a continuous stream thus I have to work with offsets.
I'm guessing an ISO mount implementation of this would be somewhat similar.

@adamhathcock
Copy link
Owner

@Xodaru
Copy link
Author

Xodaru commented Nov 2, 2023

Hi adamhathcock,
Thanks very much for that

Apologies for my stupid question, but I dont understand how this can achieve streaming part of the archive on request.
It seems to just extract the whole file and write it to disk? Basically like a normal extraction.

I want to be able to read a specific file in 1MB chunks (the offset and size to extract are parameters to the main processing method) as the data will be sent across a bus. Each time this method is called the offset to start at is updated as its the bus that decides what it needs to get.

@adamhathcock
Copy link
Owner

you have to read all bytes in a forward-only scenario. There is no seeking. Once you know the entry then you just deal with that stream

If you want to deal with seeking then use the Archive interface with your pieces: https://github.com/adamhathcock/sharpcompress/blob/master/tests/SharpCompress.Test/Rar/RarArchiveTests.cs#L253

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

2 participants