Need Simple Way To Determine If File Is Executable

Gabriel Genellina gagsl-py at yahoo.com.ar
Mon Dec 18 13:17:32 EST 2006


At Monday 18/12/2006 13:41, Tim Daneliuk wrote:

>I was working on a new release and wanted to add file associations
>to it.  That is, if the user selected a file and double clicked or
>pressed Enter, I wanted the following behavior (in the following
>steps, "type" means nothing more than "a file whose name ends with
>a particular string"):
>
>1) If an association for that file type exists, run the associated program.
>
>2) If an association for that file type does not exist:
>
>     a) If the file is not "executable", see if there is a "default"
>        association defined and run that program if there is.
>
>     b) If the file *is* "executable", run it.

This is what os.startfile does. The underlying Win32 functions would 
be ShellExecute, FindExecutable & their variants.
Will you maintain your own registry for associations?


-- 
Gabriel Genellina
Softlab SRL 

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar



More information about the Python-list mailing list