-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filetest problem with STDIN/OUT on Windows #8502
Comments
From @pmqs[Forgot to forward this to perlbug] Had a problem with my compression modules reported to me yesterday that
My windows box has an ActiveState 5.8.8 on it. Is this a known issue on windows? Paul |
From @steve-m-haypaul.marquess@ntlworld.com (via RT) wrote:
Not to me, so thanks for the report! It isn't mentioned in perlport either, but it seems to be a Windows thing. pp_ftrread() calls my_stat(), which calls PerlLIO_fstat() on the The following C program replicates the problem: /* ---------- */ On Windows, this outputs "stdin is not readable". (I tried VC++, MinGW On other platforms, it presumably says "stdin is readable". (I tried it So it looks like a(nother) Windows limitation. If no-one can see a way -- Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email. |
The RT System itself - Status changed from 'new' to 'open' |
From @demerphqOn 7/11/06, Steve Hay <steve.hay@uk.radan.com> wrote:
Or maybe fake it in whatever way that cygwin fakes it. sbuf.st_mode & _S_IFCHR is set, which is documented as "The _S_IFCHR bit is set if handle refers to a device." but sbuf.st_rdev is 0, which is documented as: "If a device, handle; otherwise 0." and _isatty( fd ) return true. So maybe under these situations we should lie and say it is readable? Yves -- |
From @steve-m-haydemerphq wrote:
You're quite right that (sbuf.st_mode & S_IFCHR) && isatty(sbuf.st_rdev) is true in the example above, but unfortunately it is also true for fd 1 Just faking fd 0 as readable and fd's 1 and 2 as writable is no good, of I couldn't see how/where Cygwin does it. I looked in Do any Cygwin gurus know more about this? -- Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email. |
From @demerphqOn 7/12/06, Steve Hay <steve.hay@uk.radan.com> wrote:
Except that then wouldnt the above test fail? Unless perhaps if they Or in less flippant terms the realm where the caveat would apply would
Ill bet a pint of beer that they fake it as well. :-) Yves -- |
From @steve-m-haydemerphq wrote:
I was actually thinking of rather less pathological cases like just perl -e "open my $dupin, '<&STDIN'; print 'readable' if -r $dupin" but here the file descriptor of $dupin is 3, not 0. -- Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email. |
From @demerphqOn 7/12/06, Steve Hay <steve.hay@uk.radan.com> wrote:
Ah ok. I see. Im still not sure thats a reason not to special case 0,1 -- |
From @pmqsFrom: Steve Hay [mailto:steve.hay@uk.radan.com]
Yep, perlport was the first place I looked to see if this was a known The test suite was my second port of call, and tests that check filetests
Ahh joy! Paul |
As discussed on the mailing list here: https://www.nntp.perl.org/group/perl.perl5.porters/2020/10/msg258453.html This just removes the declaration that we support the very old versions of Windows that have long since been EOLed. For reference of problems related to maintaining the EOLed versions: Perl#4145 Perl#6080 Perl#7410 Perl#8502 Perl#9025 Perl#12431 Perl#14687
This is partly fixed by e935ef3, so that -r/-w work on STDIN, STDOUT, STDERR, but it doesn't work on duplicates of those handles. Windows 10 has an API that might allow this to work, CompareObjectHandles(), but I haven't tried it (yet) |
@tonycoz, has there been any headway on this ticket? Thank you very much. |
Migrated from rt.perl.org#39637 (status was 'open')
Searchable as RT39637$
The text was updated successfully, but these errors were encountered: