🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.misc.discuss
Article #63261

Re: Library routines to read .Z and .gz?

#63261
From: Nik Conwell
Date: Fri, 24 Feb 1995 13:05
35 lines
2383 bytes
Matt DiMeo (mdimeo@brooktree.com) wrote:
: In article <3hvs5p$abq@news.bu.edu>, Nik Conwell <nik@bu.edu> wrote:
: >The gzip TODO file indicates that one of the planned features is a library of
: >routines that can be called to do compressed I/O.  Does anybody know of the
: >status of this, or if there are routines available?

: Dunno.  But I've written a relatively simple gzopen() function that forks
: off a gzip -d process and reads from a pipe.  I've found that in some heavily
: disk-io-bound programs, it's actually faster to read (300+ meg) files in
: gzipped form, even with the piping and decompressing.

: If anyone wants the code, send me mail.

Unfortunately, my application requires unzipping *many* gzipped files, so
doing many fork/popen() calls seems wasteful.

There's also a sample program in the gzip 1.2.4 sample directory which does a
popen() to a gzip process...

% pwd
/usr/local/src/gzip-1.2.4/sample
% head zread.c 
#include <stdio.h>

/* Trivial example of reading a gzip'ed file or gzip'ed standard input
 * using stdio functions fread(), getc(), etc... fseek() is not supported.
 * Modify according to your needs. You can easily construct the symmetric
 * zwrite program.
 *
 * Usage: zread [file[.gz]]
 * This programs assumes that gzip is somewhere in your path.
 */

--
Nik Conwell                 Boston University                   nik@bu.edu
Technical Details
Message-ID: <3ikli1$ksb@news.bu.edu>
Path: arc1-ca.pugleaf.net!nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!xlink.net!howland.reston.ans.net!news.cac.psu.edu!news.pop.psu.edu!hudson.lm.com!godot.cc.duq.edu!news.duke.edu!news.mathworks.com!uunet!world!news.bu.edu!nik
References: <3hvs5p$abq@news.bu.edu> <3ig165$gvt@btree.brooktree.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f6126,797ed81f4e730972
X-Google-Attributes: gidf6126,public
X-Google-Thread: 1025b4,797ed81f4e730972
X-Google-Attributes: gid1025b4,public
X-Google-ArrivalTime: 1995-02-24 07:36:00 PST
Path: arc1-ca.pugleaf.net!nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!xlink.net!howland.reston.ans.net!news.cac.psu.edu!news.pop.psu.edu!hudson.lm.com!godot.cc.duq.edu!news.duke.edu!news.mathworks.com!uunet!world!news.bu.edu!nik
From: nik@bu.edu (Nik Conwell)
Newsgroups: gnu.misc.discuss,comp.compression
Subject: Re: Library routines to read .Z and .gz?
Followup-To: gnu.misc.discuss,comp.compression
Date: 24 Feb 1995 13:05:05 GMT
Organization: Boston University Information Technology
Lines: 35
Message-ID: <3ikli1$ksb@news.bu.edu>
References: <3hvs5p$abq@news.bu.edu> <3ig165$gvt@btree.brooktree.com>
NNTP-Posting-Host: acs-mail.bu.edu
X-Newsreader: TIN [version 1.2 PL0]