Skip to content
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

Testing for a directory handle bug #16391

Open
p5pRT opened this issue Jan 29, 2018 · 5 comments
Open

Testing for a directory handle bug #16391

p5pRT opened this issue Jan 29, 2018 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 29, 2018

Migrated from rt.perl.org#132779 (status was 'open')

Searchable as RT132779$

@p5pRT
Copy link
Author

p5pRT commented Jan 29, 2018

From zebra__crossing86@hotmail.com

Good Day Perl bug testers

In the course of trying to solve some programming issues, I and the perl monks may have uncovered a bug

See below perl monks forum entry

https://www.perlmonks.org/?node_id=1208018

Matt

@p5pRT
Copy link
Author

p5pRT commented Jan 29, 2018

From @jkeenan

On Mon, 29 Jan 2018 05​:26​:49 GMT, zebra__crossing86@​hotmail.com wrote​:

Good Day Perl bug testers

In the course of trying to solve some programming issues, I and the
perl monks may have uncovered a bug

See below perl monks forum entry

https://www.perlmonks.org/?node_id=1208018

Since there's a fair amount of back-and-forth discussion in that thread, it's not easy to see what the bug is precisely.

Could you please post in *this* ticket a concise description of the problem?

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Jan 29, 2018

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jan 29, 2018

From @sisyphus

-----Original Message-----
From​: James E Keenan via RT
Sent​: Tuesday, January 30, 2018 2​:56 AM
To​: OtherRecipients of perl Ticket #132779​:
Cc​: perl5-porters@​perl.org
Subject​: [perl #132779] Testing for a directory handle bug

See below perl monks forum entry

https://www.perlmonks.org/?node_id=1208018

Could you please post in *this* ticket a concise description of the
problem?

I'm not the OP but the problem is that, on MS Windows, '-X DIRHANDLE'
produces a fatal error 'The dirfd function is unimplemented'.
(At least, this happens when '-X' is either '-f' or '-d'.)
This has been the case beginning with perl-5.8.9. On 5.8.8 (and earlier ?)
'-d DIRHANDLE' and '-f DIRHANDLE' would simply always silently return false.

On perl-5.27.8​:

####################
C​:\_32>perl -le "opendir $d, 'comp' or die $!; print 'ok';"
ok

C​:\_32>perl -le "opendir $d, 'comp' or die $!; print 'dir' if -d $d;"
The dirfd function is unimplemented at -e line 1.

C​:\_32>perl -le "opendir D, 'comp' or die $!; print 'dir' if -d D;"
The dirfd function is unimplemented at -e line 1.

C​:\_32>perl -le "opendir D, 'comp' or die $!; print 'dir' if -d \*D;"
The dirfd function is unimplemented at -e line 1.
####################

And no mention of any such behaviour (afaics) in either the -X documentation
or the perlport documentation.

Is there really no way to implement '-X DIRHANDLE' on Windows ?

Cheers,
Rob

@p5pRT
Copy link
Author

p5pRT commented Jan 30, 2018

From @cpansprout

On Mon, 29 Jan 2018 15​:51​:21 -0800, sisyphus wrote​:

Is there really no way to implement '-X DIRHANDLE' on Windows ?

For -f and -d, considering that perl *knows* whether it is a directory handle, it probably is possible. It shouldn’t even require a system call.

But, then, I really haven’t thought through the consequences, and I am not a Windows user.

--

Father Chrysostomos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants