| Store | Cart

Re: fileno() on directory handles

From: Leon Timmermans <faw...@gmail.com>
Mon, 24 Nov 2014 14:31:30 +0100
On Mon, Nov 24, 2014 at 1:30 PM, Aaron Crane <a...@cpan.org> wrote:

> Bo Lindbergh <2bfj...@gmail.com> wrote:> > Traditionally, an undefined result from fileno() means "not open".> > In situations where the filehandle is open but not associated with> > an OS file descriptor (e.g. PerlIO::scalar), the return value is -1.> > fileno() on dirhandles should be consistent with this and return -1> > in the "open but OS support is lacking" case.>> I don't find this argument entirely convincing, I'm afraid. It's true> that PerlIO::scalar specifically documents this behaviour, but even> so, it feels the need to qualify that by saying "currently fileno($fh)> returns -1". We do, however, return undef for a variety of other> "that's not meaningful" situations.>> That said, this would be a very easy change to make, if the consensus> is that fileno($dirhandle) should be -1 in the absence of OS support.> Any other views on this?>

I think the whole distinction was a mistake anyway. I don't really care
which direction we continue it in.

Leon

Recent Messages in this Thread
Aaron Crane Nov 23, 2014 12:41 pm
Bo Lindbergh Nov 23, 2014 07:59 pm
Aaron Crane Nov 24, 2014 12:30 pm
Leon Timmermans Nov 24, 2014 01:31 pm
Eric Brine Nov 24, 2014 01:48 pm
Aaron Crane Nov 30, 2014 03:11 pm
Jarkko Hietaniemi Nov 30, 2014 04:33 pm
Leon Timmermans Nov 30, 2014 08:41 pm
Messages in this thread