delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/06/18/08:12:04

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <376A378E.C784A63F@cr2a-di.fr>
Date: Fri, 18 Jun 1999 14:11:58 +0200
From: Arnaud Bouis <abouis AT cr2a-di DOT fr>
X-Mailer: Mozilla 4.5 [fr] (WinNT; I)
X-Accept-Language: fr
MIME-Version: 1.0
To: "cygwin AT sourceware DOT cygnus DOT com" <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: "read" bug

Earnie Boyd a écrit :

> > Looks like there's a bug with the read() function in the Cygwin lib.

> > It always returns "-1" with a "Permission denied" error code,
whatever
> > file I try it upon.
> >
> > (Unless I am misusing it somehow...can someone try it ?)
> >
>
> Supply an example, and the environment you're using.  (WinNT SP3,
Win95 OSR1,
> etc)

ok. The environment is WinNT SP4. Here is the failing code :

------------------
char    chaine[50];
int        fd2;
int        res;

fd2 = open("C:/temp/toto.txt", O_RDONLY, 0);
 printf("\n--- test de read() ---\n");
 strcpy(chaine, "");
 res = read(fd2, chaine, 10);
 if (res == -1) perror("erreur sur read");
 fprintf(stdout, "%d octets ont ete lus par read()\n", res);
 printf("chaine = %s\n", chaine);
-------------------

Note that file c`\temp\toto.txt exists and is a regular ASCII text file.

read always returns -1.

Arnaud




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