473,795 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I zip a 8 Gb file using c# ?

I need to zip up an 8Gb file using C# - do you know of any freeware libraries
I can use to accomplish this? I guess it needs to be Zip64 to support such
file sizes.

I tried something called sharpziplib but it doesn't support >2Gb files -
they are working on it however but I cannot wait...
Oct 2 '06
11 12150

"Thomas T. Veldhouse" <ve*****@yahoo. comwrote in message
news:i4******** ********@textfe .usenetserver.c om...
| Willy Denoyette [MVP] <wi************ *@telenet.bewro te:
| >
| "MrNobody" <Mr******@discu ssions.microsof t.comwrote in message
| news:E0******** *************** ***********@mic rosoft.com...
| |
| |
| | "Vadym Stetsyak" wrote:
| |
| | Hello, MrNobody!
| | >
| | MI need to zip up an 8Gb file using C# - do you know of any
freeware
| | Mlibraries
| | MI can use to accomplish this? I guess it needs to be Zip64 to
support
| | Msuch
| | Mfile sizes.
| | >
| | MI tried something called sharpziplib but it doesn't support >2Gb
| | Mfiles -
| | Mthey are working on it however but I cannot wait...
| | >
| | Did you try GZipStream?
| | (
| >
http://msdn2.microsoft.com/en-us/lib...zipstream.aspx )
| | You must be using .NET 2.0 to work with it.
| | >
| | --
| | Regards, Vadym Stetsyak
| | www: http://vadmyst.blogspot
| |
| | Looks like GZip wouldn't work either, from the 'Remarks' :
| |
| | "This class cannot be used to compress files larger than 4 GB."
| >
| Which is wrong too, actually the limit is 2GB, that's the max.size of an
| object in .NET and the GZIP library needs the complete file to be read
in a
| single byte array (which obviously is limitted to 2GB).
| >
|
| Why does GZIP require the entire file to be in memory first? It is a
sliding
| window algorithm similar to LZW. In any case, implementation is via a
| GZIPStream, which doesn't seem to require the entire file be loaded into
| memory first, so I believe 4GB is indeed the limit (which is the limit of
| addressable memory with a 32-bit pointer).
|
The limit is indeed 4GB, but it has nothing to do with the addressable
memory, this comes from the gzip RFC which requires the input file size to
be less than 4GB.
The input size is written to the compressed file as an unsigned int (module
2^32), the GZipStream implementation keeps an internal count of the number
of bytes read from the input stream and throws:
"System.IO.Inva lidDataExceptio n: The gzip stream can't contain more than 4GB
data." when the number of bytes read exeeds 2^32.

Willy.


Oct 4 '06 #11
Willy Denoyette [MVP] <wi************ *@telenet.bewro te:
|
| Why does GZIP require the entire file to be in memory first? It is a
sliding
| window algorithm similar to LZW. In any case, implementation is via a
| GZIPStream, which doesn't seem to require the entire file be loaded into
| memory first, so I believe 4GB is indeed the limit (which is the limit of
| addressable memory with a 32-bit pointer).
|
The limit is indeed 4GB, but it has nothing to do with the addressable
memory, this comes from the gzip RFC which requires the input file size to
be less than 4GB.
The input size is written to the compressed file as an unsigned int (module
2^32), the GZipStream implementation keeps an internal count of the number
of bytes read from the input stream and throws:
"System.IO.Inva lidDataExceptio n: The gzip stream can't contain more than 4GB
data." when the number of bytes read exeeds 2^32.
Agreed. I shouldn't have limitted it to addressable memory and instead
limitted it to the resolution of a 32-bit WORD. GZIP was designed originally
for 32-bit processing. The same reason that a 32-bit system is limitted to
4GB addressable memory is the reason that GZIP is limitted to 4GB file sizes.

As I indicated before, there is no reason that one can not compress a file
using GZIPStream as long as it is less than 4GB in length (it doesn't have to
be loaded into memory to compress using the stream).

--
Thomas T. Veldhouse
Key Fingerprint: 2DB9 813F F510 82C2 E1AE 34D0 D69D 1EDC D5EC AED1
Oct 4 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
4070
by: Eric Lilja | last post by:
Hello, I had what I thought was normal text-file and I needed to locate a string matching a certain pattern in that file and, if found, replace that string. I thought this would be simple but I had problems getting my algorithm to work and in order to help me find the solution I decided to print each line to screen as I read them. Then, to my surprise, I noticed that there was a space between every character as I outputted the lines to the...
3
26271
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
9
8278
by: ALI-R | last post by:
Hi,, I have two questions : 1) Is it mandatory that config file of a desktop application must be App.config 2) Is it possible to update config file in your code?? thanks for your help. ALI
13
4324
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming that this is suppossed to end up as a component for others to use, and therefore I do NOT have access to their global.cs::Session_End() how do I cleanup files that were uploaded -- but obviously left stranded when the users aborted/gave up writting...
15
4780
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is not validate based on some given rules. I also have a custom error handling page to show the...
1
19968
by: ABCL | last post by:
Hi All, I am working on the situation where 2 different Process/Application(.net) tries to open file at the same time....Or one process is updating the file and another process tries to access it, it throws an exception. How to solave this problem? So second process can wait until first process completes its processing on the file. Thanks in advance
1
1879
by: Jerry John | last post by:
I am working in ASP.NET with C#. I have a text file which contains datas with delimiters. For example:- MSH|^~\$|DISCHARGE|CLAY COUNTY MEMORIAL|||200502110939| I also have an XML file created with predefined tags. Some of the tags contain child element. I need to pass the data from the text file i.e the value within the delimiters should be passed to the corresponding tags within the XML file. I have done this through hard code. But i...
1
6510
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting" setting to be "E_ALL", notices are still not getting reported. The perms on my file are 664, with owner root and group root. The php.ini file is located at /usr/local/lib/php/php.ini. Any ideas why the setting does not seem to be having an effect? ...
9
8392
by: JimmyKoolPantz | last post by:
IDE: Visual Studio 2005 Language: VB.NET Fox Pro Driver Version: 9.0.0.3504 Problem: I currently have a problem altering a DBF file. I do not get any syntax errors when running the program. However, after I alter the table and open microsoft excel to look at any changes; I get the following error: "This file is not in a recognizable format" If I do open the file in excel it looks like its not formatted.
3
8300
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0 build with these methods, will appear to encrypt and decrypt, but the resulting decrypted file will be corrupted. I tried encrypting a .bmp file and then decrypting, the resulting decrypted file under .NET 2.0 is garbage, the .NET 1.1 build works...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10448
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10217
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9046
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2922
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.