New Post: Writing files to a Zip using AddEntry/SaveTo: Streams are closed late.
I added entry.Close() as I was having the same issue. It fixed the problem, but is there a cleaner way to Add new entries to an existing Zip file instead of using: ZipArchive and AddEntry? I checked...
View ArticleNew Post: Writing files to a Zip using AddEntry/SaveTo: Streams are closed late.
You might want the AddAllFromDirectory extension:https://github.com/adamhathcock/sharpcompress/blob/master/SharpCompress/Archive/AbstractWritableArchive.Extensions.cs I just fixed a bug with streams...
View ArticleNew Post: Support for empty directory
Hello, I found sharpcompress will lost all empty directory when use the save to method. And the archive loader of some format will not contains directory entry, like 7z. Is there some reason...
View ArticleNew Post: SaveTo cannot call many time if there an entry added from...
I don't known it's a bug or not. SaveTo cannot call many time if there an entry added from memorystream. The second time file context with that entry will be empty, I fix them by add these line in...
View ArticleNew Post: Support for empty directory
I intentionally ignore directories because it causes a lot of headaches. You can add the functionality if you like:https://github.com/adamhathcock/sharpcompress
View ArticleNew Post: SaveTo cannot call many time if there an entry added from...
Where did you add it? I think trying to reset Streams for everything will cause a problem. I'll take a closer look. I don't think I intended SaveTo to be called multiple times but I should do something...
View ArticleNew Post: SaveTo cannot call many time if there an entry added from...
Here is exampleusing (var arc = ZipArchive.Create()) { string str = "test.txt"; var source = new MemoryStream(Encoding.UTF8.GetBytes(str)); arc.AddEntry("test.txt", source, true, source.Length, null);...
View ArticleNew Post: SaveTo cannot call many time if there an entry added from...
I believe I do create each Stream on the fly with OpenEntryStream as Archives require seekable streams. I guess the solution should be that Streams added to a writable archive must be seekable and...
View ArticleNew Post: SaveTo cannot call many time if there an entry added from...
https://github.com/adamhathcock/sharpcompress/commit/d46de85ca22954f077a6d2a3dce5c12b00edb030
View ArticleNew Post: Going into subdirectories when extracting?
When enumerating entries, the directory doesn't matter. It should see entries as directory\file3 and directory\file4
View ArticleNew Post: Can make method AddEntry return the entry added?
Hello, I'm trying to manage the file tree outside of sharpcompress. I found method AddEntry will return nothing so I had to enumerate Entries each time after I add a file. Then I make a patchdiff --git...
View ArticleNew Post: SaveTo cannot call many time if there an entry added from...
I found this problem isn't completely solved yet. If two new files use a same stream, the second file content will be empty after save. example code:using (var arc = ZipArchive.Create()) { using (var...
View ArticleNew Post: Can make method AddEntry return the entry added?
Reasonable.https://github.com/adamhathcock/sharpcompress/commit/c59e6a8c9927d0fc31b2c1f9063f274738e76561
View ArticleNew Post: SaveTo cannot call many time if there an entry added from...
Fixed. I really need to refactor some of the class hierarchy thoughhttps://github.com/adamhathcock/sharpcompress/commit/97bc1865dc767fe06c7e94839beb9d4edb6c8b12
View ArticleNew Post: NotImplementedException throwed when read a stream
adamhathcock wrote: I guess ReadToEnd requires length to properly function. GZipStream is a forward-only stream implementation so length won't necessarily be known (like if you're using a...
View ArticleNew Post: NotImplementedException throwed when read a stream
I'm not sure where that AsyncExtensions class comes from. Maybe that's the Windows Phone 7 SDK that I don't currently use or have anymore. Looking at the .NET 4.5 implementation of...
View ArticleNew Post: NotImplementedException throwed when read a stream
It must be the Microsoft.Bcl.Async package doing that https://www.nuget.org/packages/Microsoft.Bcl.Async
View ArticleNew Post: NotImplementedException throwed when read a stream
adamhathcock wrote: It must be the Microsoft.Bcl.Async package doing that https://www.nuget.org/packages/Microsoft.Bcl.Async Yes, I am currently using the Microsoft.Bcl.Async package along with the...
View ArticleNew Post: How to decompress a compressed string?
Hi everyone. I managed to compress a string with the following method:public string SharpZip(string asd) { byte[] sIn = UTF8Encoding.UTF8.GetBytes(asd); MemoryStream rawDataStream = new MemoryStream();...
View ArticleNew Post: How to decompress a compressed string?
This is just a basic .NET usage question. Nothing to do with SharpCompress. However, the reason why this isn't working is because you ought to initialize your MemoryStream with the byte array (sOut)....
View Article