develooper Front page | perl.perl5.porters | Postings from July 2001

RE: This week on perl5-porters (10 June--17 June 2001)

Thread Previous | Thread Next
From:
vkonovalov
Date:
July 10, 2001 06:20
Subject:
RE: This week on perl5-porters (10 June--17 June 2001)
Message ID:
E3FB32585BF1D411B9E900805FF51A0808CA44@RU0022EXCH001U
>    Rudi Farkas found a weird one on Win32 - on that platform,
>    executableness (the -x test) is determined by the filename being
>    examined. For instance, foo.bat is classed as executable, 
> but foo.bar
>    is not, even if they contain exactly the same data. This rather
>    curious design decision leads to the fact that if you call 
> stat with a
>    filename, the execute bit is set depending on the extension. If, on
>    the other hand, you call fstat with a filehandle, Windows can't
>    retrieve the filename and test the extension, so it 
> silently sets the
>    execute bit to zero, no matter what it gets fed. This is Bad, and
>    means that -x _ on Windows is unpredictable. Radi provided 
> a suggested
>    workaround, but nobody cared enough about fixing something so
>    obviously braindead to produce a patch.

hey, this is a long known (mis)feature on Win32, Cygwin behaves slightly differently, but all Win32 have similar worms on this.
It was discussed many times, and then discussion calmed down every time.

Once I suggested a small patch to smoothen differences between Borland and MSVC CRT on this (and it was accepted), but issue is still open.

I think this is because that misbehaviour is not very critical, no-one on Win32 seriously tests files to have "executable" attribute.

Best wishes,
<!ENTITY Vadim REALLIFE "Vadim V.Konovalov, St.Petersburg, Russia">
&Vadim;

Thread Previous | Thread Next


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