-
Notifications
You must be signed in to change notification settings - Fork 532
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
-e tests not reliable under Win32 #7410
Comments
From @demerphqCreated by @demerphqThe following script produces incorrect results on Win32, Cygwin build or Original report raised in Perlmonks: use strict;
use warnings;
my @files = (' ', ' . . ', ' .. ', ' ', ' . ');
foreach (@files) {
print "[$_] - ", -e $_ ? "yes\n" : "no\n";
} Produces on the two different versions i have handy:
Perl Info
|
From @smpetersIt appears that this is OK on Cygwin now, although not on Windows. $ perl rt_30622.pl This is perl, v5.8.8 built for cygwin-thread-multi-64int |
The RT System itself - Status changed from 'new' to 'open' |
From @dcollinsnThis bug does still exist under ActiveState perl 5.24.0 x64. Is this "correct" as a quirk of Windows, or is perl actually doing something wrong? |
From zefram@fysh.orgThis looks like it's a platform quirk in filename resolution, not -zefram |
From @eserteDana Sat, 16 Dec 2017 17:06:59 -0800, zefram@fysh.org reče:
open fails with "No such file or directory" (Win7, Strawberry Perl 5.26.0.x) Regards, |
From zefram@fysh.orgslaven@rezic.de via RT wrote:
Well, that's interesting. This needs the attention of a platform expert. -zefram |
This is also reminiscent of #12431 |
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 still occurs in 5.33 blead, and the version of windows doesn't appear to be relevant. This appears to be a windows specific behaviour, I commented out the PerlDir_mapA() call from Win32 stat and the call to CreateFileA() in the new version of stat (and done by newer versions of Microsoft's UCRT) successfully opened a name of win32_opendir() uses the FindFirstFileW() function which unlike POSIX opendir wants a glob()-like pattern, so win32_opendir(), seeing no trailing / adds that and the globby "*", so for my I expect we could prevent that difference by using the Note that this would make stat() and opendir() consistently both successfully open |
Migrated from rt.perl.org#30622 (status was 'open')
Searchable as RT30622$
The text was updated successfully, but these errors were encountered: