473,765 Members | 2,097 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

fgets & zlib

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

Jan 29 '07 #1
2 2248
In article <11************ **********@v45g 2000cwv.googleg roups.com>,
<gi************ ***@gmail.comwr ote:
>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
Jan 29 '07 #2
gi************* **@gmail.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
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 ___ jt@toerring.de
\______________ ____________ http://toerring.de
Jan 29 '07 #3

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

Similar topics

3
3751
by: Alan Toppen | last post by:
I was unable to use the ZipFile class in the zipfile module in Python2.4. I got an error that zlib could not be found. Comparing my Python 2.2 installation I noticed Python 2.4 was missing a certain file: /usr/lib/python2.2/lib-dynload/zlibmodule.so. Unable to find a more elegant solution, I copied the file from my Python 2.2 directory into my Python 2.4 directory. When running my Python script it gives a warning: ...
1
7943
by: Dennis Powell | last post by:
Does anyone have a successful implementaion of the zlib.dll in VB. Net they can show me. I'm writting a class encaplsulating zlib functionality and I keep getting a System.NullReferenceException (Object reference not set to an instance of an object) when I try to call the dll's compress function. The function in the dll is declared as such: int compress (Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) I've...
0
1170
by: Jan Prochazka | last post by:
Hi, I need to decompress zip archive. I wrote a parser of zip file, i obtain the compressed data, but when i call zlib.decompress(data) on them, it throws this error: decbuf = decompressor.decompress(compressed_data) error: Error -3 while decompressing: unknown compression method I try to compress by zlib the same data which are in that file, the
7
2433
by: giuseppe.cannella | last post by:
i need to read a row on a bzip2 file like the fgets function does on a text file can you help me to find this function thank
4
7438
by: shamzz | last post by:
Hi, I've compiled (configure/make/make install) Python 2.4.4 from source on Suse Linux Enterprise Server 9 (x64). I need Python to be compiled with Zlib so that I can compile and use Zope. After installing Python, zlib doesn't seem to have been compiled with it, I've checked the /usr/local/lib/python2.4/lib-dynload/ folder and
285
8915
by: Sheth Raxit | last post by:
Machine 1 : bash-3.00$ uname -a SunOS <hostname5.10 Generic_118822-30 sun4u sparc SUNW,Sun-Fire-280R bash-3.00$ gcc -v Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/ specs gcc version 2.95.3 20010315 (release)
4
2931
by: MZ | last post by:
Hello! I`ve tried to instal zlib library to use zip functions to pack files into zip archive. I don`t know how I have to configure zlib to make it work. I have built up php.ini file and I`ve put such line --with-zlib=/home/domena_nazwa/domains/test.com/public_html/gallery/lib/zziplib.lib
6
3376
by: Gert Kok | last post by:
When fgets() reads a string that ands with <<<EOT, the string is truncated after << and a lot of following input is discarded. When <<<EOT is changed to <<< EOT, behaviour is as I expect it. Can it be explained why the content of a file is interfering with the behaviour of fgets()?
2
10355
by: rajevar | last post by:
hi, i have seen various post related to this topic but i couldnt resolve my issue yet. Im using python version 2.5 on Linux environment this is the error im getting if i try to import zlib # python -c 'import zlib' Traceback (most recent call last): File "<string>", line 1, in <module>
0
9398
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10156
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
9832
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...
1
7375
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5275
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...
0
5419
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
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
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
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.