This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: "read" bug
- To: abouis@cr2a-di.fr
- Subject: Re: "read" bug
- From: Takayuki Tamura <ttamura@icc.melco.co.jp>
- Date: Fri, 18 Jun 1999 21:32:23 +0900 (JST)
- Cc: cygwin@sourceware.cygnus.com
- References: <376A378E.C784A63F@cr2a-di.fr>
- Reply-To: ttathome@remus.dti.ne.jp
On Fri, 18 Jun 1999 14:11:58 +0200
Arnaud Bouis <abouis@cr2a-di.fr> 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@remus.dti.ne.jp
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com