develooper Front page | perl.perl5.porters | Postings from January 2011

Re: [perl #82802] [PATCH] fileno should return undef when PerlIOreturns -1

Thread Previous
From:
Leon Timmermans
Date:
January 26, 2011 08:30
Subject:
Re: [perl #82802] [PATCH] fileno should return undef when PerlIOreturns -1
Message ID:
AANLkTi=amYBojOJ8+iGpUtrFzOajRkwB-HcGoLTs19R+@mail.gmail.com
On Wed, Jan 26, 2011 at 3:31 PM, Steve Peters <steve@fisharerojo.org> wrote:
> So is the obscure method for checking if a filehandle is open now
> documented?

I'm not sure it should be, it's an implementation detail. Pointing
people to openhandle is a way better solution IMHO. I've sent a patch
for openhandle that will make it do the PerlIO dance, but if you
really want to know the core of it looks like this:

my $flags = (PerlIO::get_layers($fh, details => 1))[2];
return defined $flags and $flags & 0x00200000;

Leon

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About