Depend on SharpZipLib #372

Open
opened 2026-01-29 22:10:49 +00:00 by claunia · 14 comments
Owner

Originally created by @adamhathcock on GitHub (Sep 7, 2019).

Thinking of using https://github.com/icsharpcode/SharpZipLib Instead of directly using implementations of my own (or forked earlier). SharpZipLib used to be LGPL so I never looked at it. Now it’s MIT.

This project was never about implementing the algorithms or even the archive formats but having an easy and unified interface while allowing forward-only access.

Probably relates to #470

Originally created by @adamhathcock on GitHub (Sep 7, 2019). Thinking of using https://github.com/icsharpcode/SharpZipLib Instead of directly using implementations of my own (or forked earlier). SharpZipLib used to be LGPL so I never looked at it. Now it’s MIT. This project was never about implementing the algorithms or even the archive formats but having an easy and unified interface while allowing forward-only access. Probably relates to #470
claunia added the up for grabsfeedback requested labels 2026-01-29 22:10:49 +00:00
Author
Owner

@adamhathcock commented on GitHub (Sep 7, 2019):

Probably cannot directly use nuget packages as not much is useful. Probably some code porting is required

@adamhathcock commented on GitHub (Sep 7, 2019): Probably cannot directly use nuget packages as not much is useful. Probably some code porting is required
Author
Owner

@Svetomechc commented on GitHub (Nov 20, 2019):

Why not use https://docs.microsoft.com/ru-ru/dotnet/api/system.io.compression ?

@Svetomechc commented on GitHub (Nov 20, 2019): Why not use https://docs.microsoft.com/ru-ru/dotnet/api/system.io.compression ?
Author
Owner

@adamhathcock commented on GitHub (Nov 21, 2019):

Because I need access to a lot of the internals of archive formats and they don’t expose them. Otherwise, I’d love to.

@adamhathcock commented on GitHub (Nov 21, 2019): Because I need access to a lot of the internals of archive formats and they don’t expose them. Otherwise, I’d love to.
Author
Owner

@turbolocust commented on GitHub (Nov 23, 2019):

Offering interruptible async API's would then be more difficult, because you would loose control over portions of the code. SharpZipLib does not support them yet: https://github.com/icsharpcode/SharpZipLib/issues/223

@turbolocust commented on GitHub (Nov 23, 2019): Offering interruptible async API's would then be more difficult, because you would loose control over portions of the code. SharpZipLib does not support them yet: https://github.com/icsharpcode/SharpZipLib/issues/223
Author
Owner

@adamhathcock commented on GitHub (Nov 23, 2019):

I need to put some brain power to what the proper way is to implement async for streams. Often I see that there’s nothing really to do?

@adamhathcock commented on GitHub (Nov 23, 2019): I need to put some brain power to what the proper way is to implement async for streams. Often I see that there’s nothing really to do?
Author
Owner

@turbolocust commented on GitHub (Dec 3, 2019):

A task has to be returned, that's basically all there is to do (see this link). If the operation should be cancelable, then a CancellationToken should be supported by the API. Streams in .NET usually support this. But if instantaneous cancellation is required, the algorithm that does the archiving logic should support this as well. Also, according to the link in my previous post, SharpZipLib does not support async methods in their stream classes, which is why I wouldn't consider using their library as long as this feature is missing.

@turbolocust commented on GitHub (Dec 3, 2019): A task has to be returned, that's basically all there is to do (see [this link](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/async-return-types)). If the operation should be cancelable, then a [CancellationToken ](https://docs.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken?view=netframework-4.8) should be supported by the API. Streams in .NET usually support this. But if instantaneous cancellation is required, the algorithm that does the archiving logic should support this as well. Also, according to the link in my previous post, SharpZipLib does not support async methods in their stream classes, which is why I wouldn't consider using their library as long as this feature is missing.
Author
Owner

@adamhathcock commented on GitHub (Dec 3, 2019):

I meant more like if I use the async methods is that good enough? Would sync reuse the async code paths okay?

Not sure at the moment.

@adamhathcock commented on GitHub (Dec 3, 2019): I meant more like if I use the async methods is that good enough? Would sync reuse the async code paths okay? Not sure at the moment.
Author
Owner

@Svetomechc commented on GitHub (Dec 4, 2019):

@adamhathcock you mean sync methods actually calling async ones with .GetAwaiter().GetResult()?

@Svetomechc commented on GitHub (Dec 4, 2019): @adamhathcock you mean sync methods actually calling async ones with **.GetAwaiter().GetResult()**?
Author
Owner

@adamhathcock commented on GitHub (Dec 4, 2019):

Like if I only implement the async part of Streams, does it use that path if someone uses the sync part?

I don’t want to have people use GetAwaiter().Result() or Wait() which ties up an extra thread.

@adamhathcock commented on GitHub (Dec 4, 2019): Like if I only implement the async part of Streams, does it use that path if someone uses the sync part? I don’t want to have people use GetAwaiter().Result() or Wait() which ties up an extra thread.
Author
Owner

@Svetomechc commented on GitHub (Dec 4, 2019):

@adamhathcock that is a really good question.

@Svetomechc commented on GitHub (Dec 4, 2019): @adamhathcock that is a really good question.
Author
Owner

@Bluscream commented on GitHub (Mar 10, 2024):

that is a really good question.

which noone was ever able to answer :D

@Bluscream commented on GitHub (Mar 10, 2024): > that is a really good question. which noone was ever able to answer :D
Author
Owner

@adamhathcock commented on GitHub (Mar 11, 2024):

nope

I'd probably just make everything async and let the Stream overloads (or provide them myself)

async has been around long enough

@adamhathcock commented on GitHub (Mar 11, 2024): nope I'd probably just make everything async and let the Stream overloads (or provide them myself) async has been around long enough
Author
Owner

@Sergey-Terekhin commented on GitHub (May 23, 2024):

Just for your information: your implementation of Zip archive preserves non-ascii filenames like português.jpg or 测试.jpg or кириллица.jpg while the implementation from Microsoft (System.IO.Compression) may decode file names incorrectly. So, please, do not switch to alternate libraries :)

@Sergey-Terekhin commented on GitHub (May 23, 2024): Just for your information: your implementation of Zip archive preserves non-ascii filenames like `português.jpg` or `测试.jpg` or `кириллица.jpg` while the implementation from Microsoft (System.IO.Compression) may decode file names incorrectly. So, please, do not switch to alternate libraries :)
Author
Owner

@Bluscream commented on GitHub (May 23, 2024):

Just for your information: your implementation of Zip archive preserves non-ascii filenames like português.jpg or 测试.jpg or кириллица.jpg while the implementation from Microsoft (System.IO.Compression) may decode file names incorrectly. So, please, do not switch to alternate libraries :)

Or y'know; just fix System.IO.Compression and use that xD

@Bluscream commented on GitHub (May 23, 2024): > Just for your information: your implementation of Zip archive preserves non-ascii filenames like `português.jpg` or `测试.jpg` or `кириллица.jpg` while the implementation from Microsoft (System.IO.Compression) may decode file names incorrectly. So, please, do not switch to alternate libraries :) Or y'know; just fix System.IO.Compression and use that xD
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#372