[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gzipped data files

From: David Bateman
Subject: Re: gzipped data files
Date: Mon, 02 May 2005 10:23:18 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

John W. Eaton wrote:

On 29-Apr-2005, David Bateman wrote:

| Dmitri A. Sergatskov wrote:
| | > Since we now have all this gzip machinery in place,
| > would it be easy to add gzip option to fopen()?
| > That is, I would like to be able to do something like:
| >
| > fid = fopen("data.dat.gz","rz") | >
| > a = fscanf(fid,"%f")
| >
| > ...
| >
| > Just asking...
| >
| > Dmitri.
| | Something like that is relatively easy, as gzopen just a C file | descriptor.

?  Does it really work to pass a gzFile object to any of the stdio
functions that expect a FILE pointer?

Anyway, try the following patch.

It works in the opposite sense... A gzFile can act like a normal file descriptor if gzOpen was called with a non gzipped file..

I notice that in your patch all of the seek code is disabled... The seeking in a read-only file should work find, in a write-only file seeking in a forward direction should work, and you can't have a gzipped file open for both reading and writing at the same time.. These are limitations of zlib and normal ones and the implication of implying these features means that a buffer containing all of the data written to the file would be needed so that the gzipped file could be searched backwards, etc...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]