Quantcast
Channel: sharpcompress Discussions Rss Feed
Viewing all 239 articles
Browse latest View live

New Post: CRC Zero gz

$
0
0
Using ArchiveFactory.Open(), the entry.Crc value is zero both before and after entry.WriteToFile(). This occurs with gz files. I have found that with other compressed formats the entry.Crc is OK before the entry.WriteToFile(), but some times is cleared to zero afterwards.

New Post: Solid 7zip archive speed

$
0
0
Hi,

I've been trying to use Sharpcompress to extract 7zip files. It's working well, except that with a solid 7zip archive the extraction speed is horrible (10-20 minutes to extract a 7MB solid archive...)

First I thought, oh, I need to use the forward-only reader for solid archives ... but there isn't one for 7-zip archives.

I had a look through the code and it seems that the problem is that with the solid archive, it decompresses the entire stream from the beginning for every file. So the first file extracts quickly, the second file fairly quickly (it decompresses the first file again in order to skip it) ... but the 100th file in the archive is not so fast. I guess since the archive has ~150 files in it, the first file ends up getting decompressed 150 times, the second file 149 times, ...? :)

I made a quick hack that resolves this - when it asks for a stream from the 7zip folder, the result is cached, and if the next extraction operation needs a file that is further forwards in the same stream, it reuses that stream rather than starting from the beginning again. It works well with my archive at least - 8 seconds to extract rather than >10 minutes - but it would be good to have a fix integrated into the project so I can keep up to date with the nuget version.

I can send you my code if you want (it's <10 lines anyway!) but I don't know if you would prefer to fix it a different way.

Thanks!

New Post: Solid 7zip archive speed

$
0
0
Thanks for looking at this. I'm glad you found a fix.

I'll definitely look at your code and see if I wanted to integrate it (email is fine but Github is better). However, my first thought is that I'm not sure I want to implement some caching directly.

Have you looked at ExtractAllEntries() on the archive?

New Post: Solid 7zip archive speed

$
0
0
Ah - ExtractAllEntries looks exactly like what I need. I saw there wasn't 7zip support in the ReaderFactory and assumed that was it, but it looks like ExtractAllEntries works fine.

In that case I guess there's no need to make any changes since there is a way to extract solid files efficiently, thanks for pointing me in the right direction :)

New Post: Solid 7zip archive speed

$
0
0
Hi,

Me again I'm afraid!

I've now encountered some slightly different speed issues. Extracting using the v0.10 release from the downloads (or from NuGet) seems a lot slower than if I compile my own version using source downloaded from codeplex. (In both cases, using the exact same 'user' code calling into the library).

The version on the source code tab seems to be commit fcca5e95eafd, Apr 08, 2013 - so I'm guessing this is somewhat older than v0.10 for some reason? Maybe 0.81 guessing from the data in the download?

In any case, if I compile that version, I can extract a 11MB 7Z archive (containing 2 files) in ~7.5seconds. If I use the binary of v0.10 the same archive takes ~55s to extract (!)

I'm afraid I don't know what the cause is - since I can't see the latest version of source on Codeplex to download anyway? And am I missing any important fixes by using an earlier version? Obviously a 6x slowdown is a lot, but if the new version actually fixes some critical bugs, I don't want to be extracting corrupted data by staying on the old version...

Thanks

New Post: Solid 7zip archive speed

$
0
0
The big difference is the merging of a new 7Zip format reading. Though, the decompress should have been the same so it's odd the raw extraction time is that much slower. I ought to do some perf tests with 7Zip extraction.

If you'd run those for me with the source to see the slow down, that would be great :)

New Post: Solid 7zip archive speed

$
0
0
Actually, just solved this. Thanks for bring it up. 0.10.1 should be released shorty.

New Post: Solid 7zip archive speed

$
0
0
That's great, thank you - I'll wait for 0.10.1 then.

New Post: System.NotImplemented exception with RAR files on stream copy

$
0
0
Hi, I'm using your great Library for my Windows Store application.
I'm using the IRachive API to read content of archive files directly in memory (not extracting them to disk) and have encountered a problem:

With rar files, I get a System.NotImplemented exception when calling
streamFromArchiveEntry.CopyToAsync(outMemoryStream)
What I'm doing is simply extract the archive entry in memory so that I can use the entry content directly. This works fine with zip and 7z archives (it is however extremely slow with 7z archive files).

Have you already experienced this issue? Can something be done about it?

Thanks

New Post: System.NotImplemented exception with RAR files on stream copy (Windows Store App)

$
0
0
Hi again,

I managed to make this work by replacing the asyncornous calls with Streams with IArchiveEntry.writeTo() method:
InMemoryRandomAccessStream ras = new InMemoryRandomAccessStream();
using (Stream writeBufferStream = ras.AsStreamForWrite())
{
  entry.WriteTo(writeBufferStream);
}
This allows me to read individual RAR entries in my Windows Store app. I would still preferer to use the asynchronous Stream methods, so it might still be a good idea to look into it in the Library if you can.
Thanks for this great Library.

New Post: System.NotImplemented exception with RAR files on stream copy (Windows Store App)

$
0
0
Sorry about the exception. I haven't extensively used Windows Store apps so I haven't noticed that. Your workaround is the style I used when testing it.

If you get the callstack, it's probably simple to fix and implement the method required. I invite you to try fix :)

Pull Requests welcome:
https://github.com/adamhathcock/sharpcompress

New Post: Reading LZMA (7zip) file sequential (on-the-fly)

$
0
0
Hi,

I don't find out how to read a 7zip file sequential.
My problem is I have really huge archive files and don't want to load the hole file content into the memory or to extract the the archive into a new file.

I want to read the archive as stream on the fly.

Somethink like:
using (FileStream fs = new FileStream(file, FileMode.Open))
            {
                using (LzmaStream lzmaStream = new LzmaStream(..., false, fs))
                {
                    using (XmlTextReader reader = new XmlTextReader(lzmaStream))
                    {
                        internalReadXml(reader, fileWatchThread);
                    }
                }
            }
can somebody give me a hint how to do this?

Regards Steffen

New Post: System.NotImplemented exception with RAR files on stream copy (Windows Store App)

$
0
0
Hi, thank you for your reply.
I actually tried to compile the source code but failed due to certificate issues, so I took a different approach.
Actually, I came up with a simple solution that works asynchronously as I wanted.
InMemoryRandomAccessStream ras = new InMemoryRandomAccessStream();
using (Stream writeBufferStream = ras.AsStreamForWrite())
{
    await Task.Run(() =>
    {
        entry.WriteTo(writeBufferStream);
        writeBufferStream.Flush();
    }
);
If I manage to compile your Library, I'll see what I can do about the exception.

And once again, thanks for your great library, I works just fine (except for 7zip random access, which is really really slow for me, making it unusable)

New Post: How rar and password ? how to add a password?

$
0
0
how to add a password?

using (Stream stream = File.OpenRead(@"C:\00\22.rar"))
        {
           stream.File.Password = "password"; //  how to add a password?
            var reader = ReaderFactory.Open(stream);

            while (reader.MoveToNextEntry())
            {
                if (!reader.Entry.IsDirectory)
                {
                    Console.WriteLine(reader.Entry.FilePath);
                    reader.WriteEntryToDirectory(@"C:\00\temp", ExtractOptions.ExtractFullPath | ExtractOptions.Overwrite);
                }
            }
        }

New Post: How rar and password ? how to add a password?

$
0
0
Password protection is not on the generic interface.

Use RarReader.Open and it should have an overload for a password string

New Post: Reading LZMA (7zip) file sequential (on-the-fly)

$
0
0
No answere?

on the first page on this is written "The major feature is support for non-seekable streams so large files can be processed on the fly (i.e. download stream).".

But how??? :(

New Post: Reading LZMA (7zip) file sequential (on-the-fly)

New Post: Reading LZMA (7zip) file sequential (on-the-fly)

$
0
0
Hi Adam,

thanks for your Response. Do you have an example for me?

New Post: Attempting to access last modified time I get NotImplementedException

$
0
0
I ca get all the fields for an entry, but when I try to get any of the dattime fields I get NotImpletedException

New Post: Multi-file Archive support

$
0
0
Hi, thanks for this great library. While using it I found that it is failing to open multi-file (spanned) archives (tried zip/rar). I tried to open all the files in a spanned archive but none would open (usually the first file should be the connecting to all other).

Do I need to do any specific coding to make this work?
Is there a specific compression/ pattern/ filename extension required for this to work?

As I can't find any example anywhere can you please guide me? It will be very helpful as my current project is holding because of this functionality.

Regards
Monto
Viewing all 239 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>