Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > fgets & zlib

Reply
Thread Tools

fgets & zlib

 
 
giuseppe.cannella@gmail.com
Guest
Posts: n/a
 
      01-29-2007
i need to read a row on a gzipped file like the fgets function does on
a text file

can you help me to find this function

thank

 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      01-29-2007
In article < .com>,
<> wrote:
>i need to read a row on a gzipped file like the fgets function does on
>a text file


>can you help me to find this function


You mean something like the gzgets() function that is
documented in zlib.h -- documentation that is referred to on
the zlib manual page, and in the zlib README file at the top
level of the zlib distribution?

If so, then the question falls outside the scope of what is
defined in the C language standard, and is thus not
appropriate for comp.lang.c; you should consult
documentation specific to your implementation.
--
Is there any thing whereof it may be said, See, this is new? It hath
been already of old time, which was before us. -- Ecclesiastes
 
Reply With Quote
 
 
 
 
Jens Thoms Toerring
Guest
Posts: n/a
 
      01-29-2007
wrote:
> i need to read a row on a gzipped file like the fgets function does on
> a text file
> can you help me to find this function


I hope I understand you correctly when I assume that you want
to read a line from a file that is currently zipped and don't
want to unpack it to a file on disk before reading the line.
In that case you will have to use a third-party library since
the C language doesn't come with support for dealing with zip-
ped files. I don't know if a library exists that allows you to
read lines from zipped files, but a good starting point for a
search for something like this might be

http://zlib.net.

There you also find a link to a mailing list dedicated to zlib,
perhaps someone there will be able to tell you more.

<OT>
If you are on a system that has something like the (non-C-stand-
ard but POSIX) function popen() and you don't care about porta-
bility to systems that don't you could use that function to start
the 'unzip' program to extract the zipped file to stdout and then
use fgets() on the FILE pointer popen() returns on success.
</OT>
Regards, Jens
--
\ Jens Thoms Toerring ___
\__________________________ http://toerring.de
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Most simple usage of zlib or pr-zlib Nicholas Wieland Ruby 4 03-10-2011 04:48 AM
zlib.decompress fails, zlib.decompressobj succeeds - bug or feature? Matthew Brett Python 4 05-09-2010 09:19 PM
[ANN] pr-zlib 1.0.0 - A Pure Ruby zlib library Daniel Berger Ruby 5 06-21-2009 02:07 AM
fgets and newline Mike Mimic C++ 4 05-15-2004 06:19 AM
cin before fgets Charles Wilkins C++ 4 08-07-2003 10:14 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57