Sebastian 'lunar' Wiesner <[EMAIL PROTECTED]> wrote: > >Fredrik Lundh <[EMAIL PROTECTED]> schrieb > >> Sebastian 'lunar' Wiesner wrote: >> >>>> you're confusing the shell's "is this file executable" check with >>>> the loader's "can I execute this file" check: >... >Well, that doesn't tell us anything about, whether a file executable or >not. >But anyway: you admit, that the local file "ls" is __not__ actually >executable, although it has the x-bit set?
Sebastian, you really have missed the point of this thread. The original question was "how can I find out if a file is executable". The answer involved calling stat. On a Linux system, using stat, the definition of "executable" is "has the x mode bit set". On a Windows system, using stat, the definition is "has an extension that is in PATHEXT". Nothing more, nothing less. In both cases, the contents of the file are irrelevant. Now, when you, as a human being, try answer the question "is this file executable", you would use more sophisticated criteria that looked at the first bytes of the file, but that's not the question here. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list