delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/07/15/17:02:02

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 15 Jul 2005 16:59:40 -0400
From: Jason Tishler <jason AT tishler DOT net>
To: cygwin AT cygwin DOT com
Subject: Re: rebaseall (was Re: Perl Win32::Shortcut screws up fork)
Message-ID: <20050715205940.GA2856@tishler.net>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20050715112727 DOT GA2864 AT tishler DOT net> <SERRANO3aAnxzYROiuX00000589 AT SERRANO DOT CAM DOT ARTIMI DOT COM>
Mime-Version: 1.0
In-Reply-To: <SERRANO3aAnxzYROiuX00000589@SERRANO.CAM.ARTIMI.COM>
User-Agent: Mutt/1.4.1i
X-IsSubscribed: yes

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 <stdio.h>
    #include <string.h>
    #include <zlib.h>

    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);
    }

Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019