Any system call from decompress .Z or .gz files?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Any system call from decompress .Z or .gz files?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Any system call from decompress .Z or .gz files?  
redbox


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-11-07 12:21 PM

Any system call from decompress  .Z or .gz files?
i google it ,but can't found anythis!
Thank u






[ Post a follow-up to this message ]



    Re: Any system call from decompress .Z or .gz files?  
Jens Thoms Toerring


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-11-07 06:22 PM

redbox <guojianlee@gmail.com> wrote:
> Any system call from decompress  .Z or .gz files?

There aren't any "system calls" for uncompressing files. While
there exist some libraries for that (see e.g. www.zlib.net),
the simplest solution probably is to spawn gunzip (which can
handle both .Z and .gz files) as a process and read the decom-
pressed file content from it's output. I.e., in a very simp-
listic fashion:

FILE *fp;
fp = popen( "gunzip -c filename", "r" );
/* now read from fp like a normal file until you reach
the end of the file */
....
pclose( fp );

Getting it right with error checking etc. of course takes
a bit more of work.
Regards, Jens
--
\   Jens Thoms Toerring  ___      jt@toerring.de
\__________________________      http://toerring.de





[ Post a follow-up to this message ]



    Re: Any system call from decompress .Z or .gz files?  
Fred Kleinschmidt


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-12-07 12:28 AM


"redbox" <guojianlee@gmail.com> wrote in message
news:1184140110.349558.128120@d30g2000prg.googlegroups.com...
> Any system call from decompress  .Z or .gz files?
> i google it ,but can't found anythis!
> Thank u
>

zcat, gunzip, ...
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Aero Stability and Controls Computing







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:15 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register