delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/10/28/04:40:19

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <38180BB2.CEB29CD3@col.bsf.alcatel.fr>
Date: Thu, 28 Oct 1999 10:39:14 +0200
From: Pascal Vittone <Pascal DOT Vittone AT col DOT bsf DOT alcatel DOT fr>
X-Mailer: Mozilla 4.51 [en] (X11; I; SunOS 5.5.1 sun4u)
X-Accept-Language: fr
MIME-Version: 1.0
To: cygwin users <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: make, bash, or cygwin bug?

Chris Faylor wrote:
> 
> Well, I guess that shows how things work with Visual C.  I think that
> that means that Cygwin can't change it's behavior.
> 
> Thanks very much for doing this.  Would you mind posting your findings to
> the cygwin mailing list?
> 
> -chris
> 
> On Wed, Oct 27, 1999 at 10:01:53AM +0200, Pascal Vittone wrote:
> >Chris Faylor wrote:
> >> I'm looking for actual code which demonstrates a behavior under
> >> VC++.
> >>
> >> Can anyone supply this?
> >>
> >>cgf
> >
> >       Attached file contains test code. I compiled it with VC++ 6.0 on NT4.0 SP 4. It
> >seems that ctrl-Z is processed as end-of-file for text files.
> >
> >       Regards.
> >
> >       Pascal
> >
> >--
> >                                                    ________________
> >____________________________________________________\              /_______
> >Pascal Vittone         ESD/EBU/LSD/R&D
> >mailto:Pascal DOT Vittone AT col DOT bsf DOT alcatel DOT fr       Alcatel Business Systems
> >Tel: +33 (0)1 55 66 56 77                         54, av. Jean Jaures
> >Fax: +33 (0)1 55 66 54 24                           F-92700 Colombes
> >_________________________________________________________\    /____________


	The program hereafter displays "End of file" when it reads character ctrl-Z in
myfile.txt. I compiled it with VC++ 6.0 with default libraries. Consequently,
ctrl-Z is processed as end-of-file for text files.

	Regards,

	Pascal

// ctrlZtest.cpp : Defines the entry point for the console application.
//
 
#include "stdafx.h"
#include "stdio.h"
#include "stdlib.h"
 
int main(int argc, char* argv[])
{
	FILE *pF;
	int i;

        pF = fopen ("myfile.txt", "w");
        for (i = 0; i < 127; i++)
                fwrite (& i, 1, 1, pF);
        fclose (pF);
        pF = fopen ("myfile.txt", "r");
        for (i = 0; i < 127; i++)
        {
                char j;
 
                if (fread (& j, 1, 1, pF) == 0)
                {
                        if (feof (pF))
                                fprintf (stderr, "End of file\n");
                        else
                                fprintf (stderr, "read error\n");
                        exit (-1);
                }
                printf ("Value is %d\n", j);
        }
        return 0;
}

-- 
                                                    ________________
____________________________________________________\              /_______
Pascal Vittone		ESD/EBU/LSD/R&D
mailto:Pascal DOT Vittone AT col DOT bsf DOT alcatel DOT fr	Alcatel Business Systems
Tel: +33 (0)1 55 66 56 77			   54, av. Jean Jaures
Fax: +33 (0)1 55 66 54 24			     F-92700 Colombes
_________________________________________________________\    /____________
                                                          \  /
                                                           \/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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