public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* "read" bug
@ 1999-06-18  1:24 Arnaud Bouis
  1999-06-30 22:10 ` Arnaud Bouis
  0 siblings, 1 reply; 20+ messages in thread
From: Arnaud Bouis @ 1999-06-18  1:24 UTC (permalink / raw)
  To: cygwin

First, hello to everyone on this list, which I am joining ;)

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

Cheers,
Arnaud Bouis


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* "read" bug
  1999-06-18  1:24 "read" bug Arnaud Bouis
@ 1999-06-30 22:10 ` Arnaud Bouis
  0 siblings, 0 replies; 20+ messages in thread
From: Arnaud Bouis @ 1999-06-30 22:10 UTC (permalink / raw)
  To: cygwin

First, hello to everyone on this list, which I am joining ;)

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

Cheers,
Arnaud Bouis


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
  1999-06-18  5:11 Arnaud Bouis
  1999-06-18  5:33 ` Takayuki Tamura
  1999-06-18  5:40 ` Arnaud Bouis
@ 1999-06-30 22:10 ` Arnaud Bouis
  2 siblings, 0 replies; 20+ messages in thread
From: Arnaud Bouis @ 1999-06-30 22:10 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 994 bytes --]

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@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
  1999-06-18  5:40 ` Arnaud Bouis
  1999-06-18  6:02   ` Takayuki Tamura
@ 1999-06-30 22:10   ` Arnaud Bouis
  1 sibling, 0 replies; 20+ messages in thread
From: Arnaud Bouis @ 1999-06-30 22:10 UTC (permalink / raw)
  To: cygwin

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

Ok, the mystery clears a little...I am now getting the same error code with
cygwin's opendir(). And yet, the files and directories used have "full
access control" for "everyone".
I really am no NT expert, but there seems to be some permission problem that
escapes me.
At any rate, if someone else has ascertained that read() works on NT4 SP4,
I'll stop thinking that CYGWIN is the culprit.

Takayuki: yes, fd2 is valid. I tested its value, it's worth 3, not 0.

Arnaud


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
  1999-06-18  6:02   ` Takayuki Tamura
  1999-06-18  6:09     ` Arnaud Bouis
@ 1999-06-30 22:10     ` Takayuki Tamura
  1 sibling, 0 replies; 20+ messages in thread
From: Takayuki Tamura @ 1999-06-30 22:10 UTC (permalink / raw)
  To: abouis; +Cc: cygwin

Hmm, that's funny...

BTW, can you successfully "cat" the file from bash?

On Fri, 18 Jun 1999 14:40:09 +0200
Arnaud Bouis <abouis@cr2a-di.fr> wrote:

> Ok, the mystery clears a little...I am now getting the same error code with
> cygwin's opendir(). And yet, the files and directories used have "full
> access control" for "everyone".

> Takayuki: yes, fd2 is valid. I tested its value, it's worth 3, not 0.

Regards,
---------------
Takayuki TAMURA
ttathome@remus.dti.ne.jp

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
  1999-06-18  5:33 ` Takayuki Tamura
@ 1999-06-30 22:10   ` Takayuki Tamura
  0 siblings, 0 replies; 20+ messages in thread
From: Takayuki Tamura @ 1999-06-30 22:10 UTC (permalink / raw)
  To: abouis; +Cc: cygwin

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* "read" bug
  1999-06-18  4:44 Arnaud Bouis
@ 1999-06-30 22:10 ` Arnaud Bouis
  0 siblings, 0 replies; 20+ messages in thread
From: Arnaud Bouis @ 1999-06-30 22:10 UTC (permalink / raw)
  To: cygwin

First, hello to everyone on this list, which I am joining ;)
(I hope I did not send this to the list twice)

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

Cheers,
Arnaud Bouis




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
  1999-06-18  6:09     ` Arnaud Bouis
  1999-06-18  6:44       ` Takayuki Tamura
@ 1999-06-30 22:10       ` Arnaud Bouis
  1 sibling, 0 replies; 20+ messages in thread
From: Arnaud Bouis @ 1999-06-30 22:10 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

Takayuki Tamura a écrit :

> Hmm, that's funny...
>
> BTW, can you successfully "cat" the file from bash?

Yes, I can.




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
  1999-06-18  6:44       ` Takayuki Tamura
  1999-06-18  7:08         ` Arnaud Bouis
@ 1999-06-30 22:10         ` Takayuki Tamura
  1 sibling, 0 replies; 20+ messages in thread
From: Takayuki Tamura @ 1999-06-30 22:10 UTC (permalink / raw)
  To: abouis; +Cc: cygwin

On Fri, 18 Jun 1999 15:09:34 +0200
Arnaud Bouis <abouis@cr2a-di.fr> wrote:

> > BTW, can you successfully "cat" the file from bash?
> 
> Yes, I can.

"cat" uses read(), so it's working.

Now, give us more detailed information on how you built the program.

Regards,
---------------
Takayuki TAMURA
ttathome@remus.dti.ne.jp

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
  1999-06-18  7:08         ` Arnaud Bouis
@ 1999-06-30 22:10           ` Arnaud Bouis
  0 siblings, 0 replies; 20+ messages in thread
From: Arnaud Bouis @ 1999-06-30 22:10 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 756 bytes --]

Takayuki Tamura a écrit :

> "cat" uses read(), so it's working.
>
> Now, give us more detailed information on how you built the program.

Takayuki,
I'm not sure I 'll give useful info, but here is how I did:

I wrote a test_cygwin.c file with my favorite text editor, and compiled
it under bash-2.02.
I used GNU gcc to compile it (cc src/test_cygwin.c). I got this compiler
from the
latest "full" tool package proposed at all the Cygwin ftp mirror sites.
I then ran the resulting a.exe under a DOS shell.

The strangest is that, after I have opened the file, I can write() to it
successfully (if I use the O_RDWR flag), but not read().

Cheers,
Arnaud


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
  1999-06-18  4:54 Earnie Boyd
@ 1999-06-30 22:10 ` Earnie Boyd
  0 siblings, 0 replies; 20+ messages in thread
From: Earnie Boyd @ 1999-06-30 22:10 UTC (permalink / raw)
  To: Arnaud Bouis, cygwin

--- Arnaud Bouis <abouis@cr2a-di.fr> wrote:
> First, hello to everyone on this list, which I am joining ;)
Hello Arnaud,
> (I hope I did not send this to the list twice)
You did.
> 
> 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)

===
Earnie Boyd < mailto:earnie_boyd@yahoo.com >

Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >

(If you respond to the list, then please don't include me)
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
  1999-06-18  6:44       ` Takayuki Tamura
@ 1999-06-18  7:08         ` Arnaud Bouis
  1999-06-30 22:10           ` Arnaud Bouis
  1999-06-30 22:10         ` Takayuki Tamura
  1 sibling, 1 reply; 20+ messages in thread
From: Arnaud Bouis @ 1999-06-18  7:08 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 756 bytes --]

Takayuki Tamura a écrit :

> "cat" uses read(), so it's working.
>
> Now, give us more detailed information on how you built the program.

Takayuki,
I'm not sure I 'll give useful info, but here is how I did:

I wrote a test_cygwin.c file with my favorite text editor, and compiled
it under bash-2.02.
I used GNU gcc to compile it (cc src/test_cygwin.c). I got this compiler
from the
latest "full" tool package proposed at all the Cygwin ftp mirror sites.
I then ran the resulting a.exe under a DOS shell.

The strangest is that, after I have opened the file, I can write() to it
successfully (if I use the O_RDWR flag), but not read().

Cheers,
Arnaud


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
  1999-06-18  6:09     ` Arnaud Bouis
@ 1999-06-18  6:44       ` Takayuki Tamura
  1999-06-18  7:08         ` Arnaud Bouis
  1999-06-30 22:10         ` Takayuki Tamura
  1999-06-30 22:10       ` Arnaud Bouis
  1 sibling, 2 replies; 20+ messages in thread
From: Takayuki Tamura @ 1999-06-18  6:44 UTC (permalink / raw)
  To: abouis; +Cc: cygwin

On Fri, 18 Jun 1999 15:09:34 +0200
Arnaud Bouis <abouis@cr2a-di.fr> wrote:

> > BTW, can you successfully "cat" the file from bash?
> 
> Yes, I can.

"cat" uses read(), so it's working.

Now, give us more detailed information on how you built the program.

Regards,
---------------
Takayuki TAMURA
ttathome@remus.dti.ne.jp

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
  1999-06-18  6:02   ` Takayuki Tamura
@ 1999-06-18  6:09     ` Arnaud Bouis
  1999-06-18  6:44       ` Takayuki Tamura
  1999-06-30 22:10       ` Arnaud Bouis
  1999-06-30 22:10     ` Takayuki Tamura
  1 sibling, 2 replies; 20+ messages in thread
From: Arnaud Bouis @ 1999-06-18  6:09 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

Takayuki Tamura a écrit :

> Hmm, that's funny...
>
> BTW, can you successfully "cat" the file from bash?

Yes, I can.




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
  1999-06-18  5:40 ` Arnaud Bouis
@ 1999-06-18  6:02   ` Takayuki Tamura
  1999-06-18  6:09     ` Arnaud Bouis
  1999-06-30 22:10     ` Takayuki Tamura
  1999-06-30 22:10   ` Arnaud Bouis
  1 sibling, 2 replies; 20+ messages in thread
From: Takayuki Tamura @ 1999-06-18  6:02 UTC (permalink / raw)
  To: abouis; +Cc: cygwin

Hmm, that's funny...

BTW, can you successfully "cat" the file from bash?

On Fri, 18 Jun 1999 14:40:09 +0200
Arnaud Bouis <abouis@cr2a-di.fr> wrote:

> Ok, the mystery clears a little...I am now getting the same error code with
> cygwin's opendir(). And yet, the files and directories used have "full
> access control" for "everyone".

> Takayuki: yes, fd2 is valid. I tested its value, it's worth 3, not 0.

Regards,
---------------
Takayuki TAMURA
ttathome@remus.dti.ne.jp

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
  1999-06-18  5:11 Arnaud Bouis
  1999-06-18  5:33 ` Takayuki Tamura
@ 1999-06-18  5:40 ` Arnaud Bouis
  1999-06-18  6:02   ` Takayuki Tamura
  1999-06-30 22:10   ` Arnaud Bouis
  1999-06-30 22:10 ` Arnaud Bouis
  2 siblings, 2 replies; 20+ messages in thread
From: Arnaud Bouis @ 1999-06-18  5:40 UTC (permalink / raw)
  To: cygwin

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

Ok, the mystery clears a little...I am now getting the same error code with
cygwin's opendir(). And yet, the files and directories used have "full
access control" for "everyone".
I really am no NT expert, but there seems to be some permission problem that
escapes me.
At any rate, if someone else has ascertained that read() works on NT4 SP4,
I'll stop thinking that CYGWIN is the culprit.

Takayuki: yes, fd2 is valid. I tested its value, it's worth 3, not 0.

Arnaud


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
  1999-06-18  5:11 Arnaud Bouis
@ 1999-06-18  5:33 ` Takayuki Tamura
  1999-06-30 22:10   ` Takayuki Tamura
  1999-06-18  5:40 ` Arnaud Bouis
  1999-06-30 22:10 ` Arnaud Bouis
  2 siblings, 1 reply; 20+ messages in thread
From: Takayuki Tamura @ 1999-06-18  5:33 UTC (permalink / raw)
  To: abouis; +Cc: cygwin

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
@ 1999-06-18  5:11 Arnaud Bouis
  1999-06-18  5:33 ` Takayuki Tamura
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Arnaud Bouis @ 1999-06-18  5:11 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 994 bytes --]

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@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: "read" bug
@ 1999-06-18  4:54 Earnie Boyd
  1999-06-30 22:10 ` Earnie Boyd
  0 siblings, 1 reply; 20+ messages in thread
From: Earnie Boyd @ 1999-06-18  4:54 UTC (permalink / raw)
  To: Arnaud Bouis, cygwin

--- Arnaud Bouis <abouis@cr2a-di.fr> wrote:
> First, hello to everyone on this list, which I am joining ;)
Hello Arnaud,
> (I hope I did not send this to the list twice)
You did.
> 
> 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)

===
Earnie Boyd < mailto:earnie_boyd@yahoo.com >

Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >

(If you respond to the list, then please don't include me)
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* "read" bug
@ 1999-06-18  4:44 Arnaud Bouis
  1999-06-30 22:10 ` Arnaud Bouis
  0 siblings, 1 reply; 20+ messages in thread
From: Arnaud Bouis @ 1999-06-18  4:44 UTC (permalink / raw)
  To: cygwin

First, hello to everyone on this list, which I am joining ;)
(I hope I did not send this to the list twice)

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

Cheers,
Arnaud Bouis




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~1999-06-30 22:10 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-18  1:24 "read" bug Arnaud Bouis
1999-06-30 22:10 ` Arnaud Bouis
1999-06-18  4:44 Arnaud Bouis
1999-06-30 22:10 ` Arnaud Bouis
1999-06-18  4:54 Earnie Boyd
1999-06-30 22:10 ` Earnie Boyd
1999-06-18  5:11 Arnaud Bouis
1999-06-18  5:33 ` Takayuki Tamura
1999-06-30 22:10   ` Takayuki Tamura
1999-06-18  5:40 ` Arnaud Bouis
1999-06-18  6:02   ` Takayuki Tamura
1999-06-18  6:09     ` Arnaud Bouis
1999-06-18  6:44       ` Takayuki Tamura
1999-06-18  7:08         ` Arnaud Bouis
1999-06-30 22:10           ` Arnaud Bouis
1999-06-30 22:10         ` Takayuki Tamura
1999-06-30 22:10       ` Arnaud Bouis
1999-06-30 22:10     ` Takayuki Tamura
1999-06-30 22:10   ` Arnaud Bouis
1999-06-30 22:10 ` Arnaud Bouis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).