This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: perl -x doesn't recognize file as executable


Krzysztof Duleba wrote:

Volker Quetschke wrote:


I stumbled over the following problem, perl's -x doesn't recognize
some files as executable, even though they are and test -x does.


It works for me if the file is group or world executable.

Works for me anyway, as long as I am probing a Cygwin executable:


$ chmod 777 /usr/bin/cat.exe
$ ls -l /usr/bin/cat.exe
-rwxrwxrwx+ 1 gerrit ???????? 21504 Apr 14 14:26 /usr/bin/cat.exe
$ perl -e 'if ( ! -x "/usr/bin/cat.exe" ) {print "not executable\n";} else {print "executable\n";}'
executable



$ chmod 755 /usr/bin/cat.exe
$ ls -l /usr/bin/cat.exe
-rwxr-xr-x+ 1 gerrit ???????? 21504 Apr 14 14:26 /usr/bin/cat.exe
$ perl -e 'if ( ! -x "/usr/bin/cat.exe" ) {print "not executable\n";} else {print "executable\n";}'
executable



$ chmod 700 /usr/bin/cat.exe
$ ls -l /usr/bin/cat.exe
-rwx------+ 1 gerrit ???????? 21504 Apr 14 14:26 /usr/bin/cat.exe
$ perl -e 'if ( ! -x "/usr/bin/cat.exe" ) {print "not executable\n";} else {print "executable\n";}'
executable



$ chmod 500 /usr/bin/cat.exe
$ ls -l /usr/bin/cat.exe
-r-x------+ 1 gerrit ???????? 21504 Apr 14 14:26 /usr/bin/cat.exe
$ perl -e 'if ( ! -x "/usr/bin/cat.exe" ) {print "not executable\n";} else {print "executable\n";}'
executable




When I test e.g. mozilla.exe which I'm not the owner:
$ ls -l /c/Programme/Mozilla/mozilla.exe
-rwx------+ 1 Administratoren Domänen-Benutzer 98192 May 11 14:07 /c/Programme/Mozilla/mozilla.exe
$ perl -e 'if ( ! -x "/c/Programme/Mozilla/mozilla.exe" ) {print "not executable\n";} else {print "executable\n";}'
not executable



Gerrit -- =^..^=


-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]