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

Change Stream type to io.Reader #379

Closed
wants to merge 1 commit into from
Closed

Conversation

aol-nnov
Copy link

Wild guesses and musings on #358

@mholt please find my changes concerned the ArchiveFS Stream type.

At first sight, it should not do any harm as zip archiver has type assertion inside and other types do not need a SectionReader (and your zip tests still pass :) )

Wild guesses and musings on mholt#358
@mholt
Copy link
Owner

mholt commented May 1, 2023

Thanks for this!

I think this LGTM, but I want @tgulacsi to double-check since I know he was using the SectionReader as of #307, and although I imagine this change should be fine, I want to see what he says first 👍

@tgulacsi
Copy link
Contributor

tgulacsi commented May 1, 2023

AFAIU this will advance the underlying Reader on Stat and ReadDir. I don't know whether this will cause problems with a .tar gz or not, just noticed it.

@mholt
Copy link
Owner

mholt commented May 1, 2023

@tgulacsi Thanks, although, I'm not sure I understand why:

this will advance the underlying Reader on Stat and ReadDir.

If the value of the Stream field (type io.Reader) is actually a *SectionReader, wouldn't the behavior remain the same? Why would anything be different? Edit: Oh, or are you talking about the other 3 changes that remove the SectionReader?

@tgulacsi
Copy link
Contributor

tgulacsi commented May 2, 2023

Yes, those changes use the Reader, which will advance if Read is called on them. (Not, if a new asectionReader is created.)

@mholt
Copy link
Owner

mholt commented May 2, 2023

Understood. Ok, that makes sense.

@aol-nnov We may need to preserve the SectionReader. I believe calling Read on the underlying reader otherwise is significant.

@aol-nnov
Copy link
Author

aol-nnov commented May 2, 2023

Okay, @mholt, limitations understood.

@mholt mholt closed this May 2, 2023
@mholt
Copy link
Owner

mholt commented May 2, 2023

Thanks for letting me see the change anyway! :)

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

Successfully merging this pull request may close these issues.

None yet

3 participants