Need Simple Way To Determine If File Is Executable
John McMonagle
jmcmonagle at velseis.com.au
Thu Dec 14 17:21:33 EST 2006
Tim Daneliuk wrote:
> I have a program wherein I want one behavior when a file is set as executable
> and a different behavior if it is not. Is there a simple way to determine
> whether a given named file is executable that does not resort to all the
> lowlevel ugliness of os.stat() AND that is portable across Win32 and *nix?
>
os.access(pathToFile, os.X_OK)
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the Python-list
mailing list