[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: [ID 19991230.006] open >&= works on RDONLY filehandle?



In article <200001021725.JAA05334@activestate.com>,
Gurusamy Sarathy <gsar@ActiveState.com> wrote:
>On 30 Dec 1999 23:16:23 GMT, joseph@cscaper.com wrote:
>>use POSIX;
>>$fd = POSIX::open("foo", O_RDONLY, 0644) or die $!;
>>open FH, ">&=$fd" or die $!;
>>print FH "here's something\n" or die $!;
>>
>>Does it make sense that this yields no errors?
>
>This looks Solaris-specific.  The fdopen() fails properly on Linux 2.0.36
>with glibc.

Under os2 it also doesn't give an error.  However, adding a close FH
does get an EACCES error.  Changing the print to:

print FH 'x' x 10000 or die $!;

also gets an error.

It is not clear to me that the standards require fdopen to check this.
Perhaps it is simply left as undefined behaviour.


References to:
Gurusamy Sarathy <gsar@ActiveState.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]