Capture file descriptors while running an external program

Gabriel Genellina gagsl-py at yahoo.com.ar
Fri Nov 24 19:29:41 EST 2006


At Wednesday 22/11/2006 09:40, jfigueiras at sapo.pt wrote:

>I have a problem with the module subprocess!
>The problem is that the external software that I am running under
>subprocess.Popen opens stdin, stdout, stderr, and other file descriptors to
>write and read in the hard drive.

As many other programs...

>I know how to capture stdin, stdout and stderr, what I cannot do is to capture
>the other file-descriptors. Is there any way to wrap those non-standard file
>descriptors and make them write and read from a specific object that I define?
>I know that I can use tmp files to do that, but i would like something running
>without tmp files.

I'm not sure what you mean by "non-standard file descriptors". The 
other program is free to open, read, write, etc any file he wants - 
are you trying to trap any file operation it may want to do?
You *could* do such things -google for "code injection" and "API 
hooking"- but I doubt it's what you really want.


-- 
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