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 To: abouis AT cr2a-di DOT fr Cc: cygwin AT sourceware DOT cygnus DOT com Subject: Re: "read" bug Reply-To: ttathome AT remus DOT dti DOT ne DOT jp In-Reply-To: Your message of "Fri, 18 Jun 1999 14:11:58 +0200" <376A378E DOT C784A63F AT cr2a-di DOT fr> References: <376A378E DOT C784A63F AT cr2a-di DOT fr> X-Mailer: Mew version 1.93 on Emacs 20.2 / Mule 3.0 (MOMIJINOGA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <19990618213223P.ttamura@icc.melco.co.jp> Date: Fri, 18 Jun 1999 21:32:23 +0900 (JST) From: Takayuki Tamura X-Dispatcher: imput version 980905(IM100) Lines: 28 On Fri, 18 Jun 1999 14:11:58 +0200 Arnaud Bouis wrote: > 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. Did you confirm fd2 was valid? It could be open() that failed. --------------- Takayuki TAMURA ttathome AT remus DOT dti DOT ne DOT jp -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com