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
Win32: -e '"' always returns true #12431
Comments
From @sisyphusSubject: Win32: -e '"' always returns true This is a bug report for perl from sisyphus1@optusnet.com.au, Hi, This (raised recently at http://www.perlmonks.org/index.pl?node_id=979494) It's behaviour that's specific to MS Windows - for all versions of perl back ############################### use warnings; print "1: huh?\n" if -e '"'; __END__ 1: huh? ############################### That's pretty astounding at first glance - given that the doublequote symbol Apparently this behaviour results from a Windows system practice of treating For me, this behaviour just doesn't DWIM at all, and it also doesn't match Dunno ... I'll leave it up to p5p to decide how this should be handled. My view is that if the behaviour is to be kept as is, then we should at NOTE: On MS windows, if the specified filename consists solely of one And perhaps a similar notice for 'stat' in the perlfunc and perlport docs. Cheers, Flags: Site configuration information for perl 5.16.0: Configured by Rob at Mon May 28 14:31:11 2012. Summary of my perl5 (revision 5 version 16 subversion 0) configuration: Platform: Locally applied patches: @INC for perl 5.16.0: Environment for perl 5.16.0: |
From @ikegamiIt performs other shell interpolation too.
|
The RT System itself - Status changed from 'new' to 'open' |
From @ikegamiOn Fri, Sep 21, 2012 at 4:03 PM, Eric Brine <ikegami@adaelis.com> wrote:
Nevermind. Bad test. |
From vadim.konovalov@alcatel-lucent.com
As for my knowledge, doublequote does not mean anything,
IMO -f '"' should be undef
it appears that doublequote is prohibited in filenames on Windows, similarily So - from one side, -f should return false in all such cases, because a file Another question - is it OS or filesystem? |
From @sisyphus----- Original Message -----
And the way I read it, that's what the documentation implies. AFAIK, -e and -f are the only switches that contravene the -X documentation.
Yes, the doublequote is prohibited.
I think it's OS .... but I don't really know for sure. Cheers, |
From @bulk88
Use a C debugger. Win32 Perl has alot of file path manipulation code in perlhost.h, win32io.c and win32.c to enable POSIX paths or unclean (directory name without or without a trailing "\") to work on short file name DOS Windows and other little bugs and strange things around the Win32 API. PerlDir_mapA is a common function that is called. Rather than take a "read your OS's CLib manpage" approach the way perl does on Unix (I think thats the usually explanation Perl people give for "this works on Linux but not Solaris/AIX/OSX"), Win32 Perl tries to create a POSIX compatibility layer over Win32 so alot of Unix Perl scripts will work unmodified on Win32. Plus remember the all file IO goes through the MS CRT which itself has some "posix compatibility layer" stuff going on. So there are 3 main suspects and 2 unlikely suspects for what causes q!"! to be a valid file name, Perl's /win32 directory in src code, the MS CRT, or the Kernel32 API, and as a semi-jk let us throw in NTDLL/Native API's path processing, or the NTFS or FAT32 FS driver's path processing too. |
From @janduboisOn Mon, 24 Sep 2012, bulk 88 wrote:
I'm pretty sure that the PerlDir_mapA() processing is the underlying To maintain this illusion Perl cannot rely on the system CWD to resolve Cheers, |
I understand the underlying problem hasn't been resolved, but I don't see anything we can do. The last comment from @jandubois seems to indicate this is not going to be fixed, right? |
Possibly something that could be looked at as part of any future revamp of filename handling on Windows to fix #9578 and related "Unicode and System Calls" limitations? |
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 fixed in blead, probably by e935ef3. I expect it was also fixed in builds with recent MSVC, since the UCRT uses CreateFile() to open the file to stat rather than FindFirstFile() as MSVCRT does. |
Migrated from rt.perl.org#114986 (status was 'open')
Searchable as RT114986$
The text was updated successfully, but these errors were encountered: