From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28994 invoked by alias); 16 Jul 2005 00:32:11 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 28986 invoked by uid 22791); 16 Jul 2005 00:32:08 -0000 Received: from [82.139.192.138] (HELO koeln.convey.de) (82.139.192.138) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 16 Jul 2005 00:32:08 +0000 Received: from [192.168.1.12] ([192.168.1.12]:3518) by koeln.convey.de with [XMail 1.21 ESMTP Server] id for from ; Sat, 16 Jul 2005 02:32:06 +0200 Message-ID: <42D85585.4070206@familiehaase.de> Date: Sat, 16 Jul 2005 00:32:00 -0000 From: "Gerrit P. Haase" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: rebaseall (was Re: Perl Win32::Shortcut screws up fork) References: <20050715112727.GA2864@tishler.net> <20050715205940.GA2856@tishler.net> In-Reply-To: <20050715205940.GA2856@tishler.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2005-07/txt/msg00748.txt.bz2 Jason Tishler wrote: > On Fri, Jul 15, 2005 at 01:21:11PM +0100, Dave Korn wrote: > >>----Original Message---- >> >>>From: Jason Tishler >>>Sent: 15 July 2005 12:27 >> >>>Exactly! Right after my previous post, I started to investigate >>>enhancing rebase to support rebaseall functionality. I quickly >>>realized that this change would not require too much effort. >> >> Reading the .gz files will probably be the worst bit of it! > > > Actually, the above was much easier than I thought. I came up with the > following test program in just a few minutes: > > #include > #include > #include > > int > main(int argc, const char* argv[]) > { > const char* filename = argv[1]; > const char* mode = "rb"; > const int size = 1024; > char buffer[size]; > > gzFile file = gzopen(filename, mode); > while (gzgets(file, buffer, size) > 0) > { > int length = strlen(buffer); > if (buffer[length - 1] == '\n') > buffer[length - 1] = '\0'; > puts(buffer); > } > gzclose(file); > } Cool! You're the best ;) $ ./readgz /etc/setup/bc.lst.gz usr/ usr/bin/ usr/bin/bc.exe usr/bin/dc.exe usr/share/ usr/share/info/ usr/share/info/bc.info usr/share/info/dc.info usr/share/man/ usr/share/man/man1/ usr/share/man/man1/bc.1 usr/share/man/man1/dc.1 Gerrit -- =^..^= -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/