tags:

views:

314

answers:

3

I have coded a soltion to gz some transaction logs up, however some of them are larger than 4gb and the error I get is :-

"The gzip stream can't contain more than 4GB data"

ok so the Compression does not support anything greater than 4gb, does anyone have any good alternative libraries ?

+2  A: 

Gzip can, technically, be used for >4GB, but the standard gzip distribution does not support this by default. Because of this, many gzip related tools (such the the .NET GZipStream class) have a 4GB limitation.

You might want to use a commercial compression library instead. One example would be .NET Zip, which supports large compression sizes (via Zip-64) support.

Reed Copsey
A: 

How are you compressing your files? Are you using gzip itself, or a library?

Gzip support for > 4GB is only in later 1.3.x versions, although a patch has been provided for 1.2.4 sources.

See Can gzip handle files of more than 4 gigabytes?

Note also that there may be limitations based on the file system you are using, though if you have a file already bigger than 4GB then we'll assume there's no filesystem limit here.

tjmoore
+1  A: 

As this is for a very simple application I have decided to open an instance of Winzip from c#

    public static void Compress(FileInfo fi)
    {
        System.Diagnostics.Process process;
        process = new System.Diagnostics.Process();
        process.EnableRaisingEvents = true;

        string cmd = string.Format(@"/C ""c:\program files\winzip\WINZIP32.EXE"" -min -a {0} {1}", "C:\\testzipit\\q", fi.FullName  );
        System.Diagnostics.Process.Start("CMD.exe", cmd);
        process.Close();
    }

Works well for the case I am trying to solve.

Youeee