Need Simple Way To Determine If File Is Executable

Gabriel Genellina gagsl-py at yahoo.com.ar
Sat Dec 16 18:19:39 EST 2006


On 16 dic, 04:47, Tim Roberts <t... at probo.com> wrote:
> >   os.stat(selected)[ST_MODE] & (S_IXUSR|S_IXGRP|S_IXOTH

>This will tell you that "x.exe" is executable, even if "x.exe" contains
> nothing but zeros.

Isn't the same with any other recipe, portable or not? Unless the OS
actually tries to load and examine the file contents, which the OS's
I'm aware of, don't do.

-- 
Gabriel Genellina




More information about the Python-list mailing list