473,324 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Capture file descriptors while running an external program

>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

Hi Gabriel!

When I wrote "non-standard file descriptors", I meant the file descriptior which
are pointed to files in the hardrive.
What I would like to do is not to trap any file operation, but instead intercept
that file operation, i.e. I would like the output of the external program to
don't be writen in a file (its normal behavior), but instead be sent to any
variable in my program.
I know the name of the file where the external program will write the output.. I
pass its name along the command line.

Joao Figueiras

__________________________________________________ _________________

O SAPO já está livre de vírus com a Panda Software, fique você também!
Clique em: http://antivirus.sapo.pt

Nov 25 '06 #1
0 1358

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Kiran | last post by:
Hi, I have program, which opens file at the startup and logs error messages to the file, file handle is closed at the end of the program. However if file is deleted in-between, program do not...
3
by: JeffDotNet | last post by:
I wrote a small data processing application that writes a summary of several hundred files. I use drag and drop on a panel (Panel1) to grab the absolute path to each of these files. Then I begin...
0
by: jfigueiras | last post by:
Hi all! 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...
0
by: j101 | last post by:
I am attempting to set up Q Capture on RH Linux (x86_64) using DB2 9 fp2, but there seems to be a general problem loading a specify MQ shared library "/opt/mqm/lib/libmqm_r.so". I have MQ v6...
3
by: RICHARD BROMBERG | last post by:
I have a simple program to test using an external .js file. This external file contains some functions that I need to call from several html programs. The program as written below works fine. ...
1
by: sangith | last post by:
Hi, I tried the packet capture module program. I did a file transfer using ftp from this host to another server. But when I ran the program, it was just hanging off and it did not print the...
5
by: yinglcs | last post by:
I have a c/c++ program in linux. I would like to know if I kill my program (e.g. exit(1)), will it release all the file descriptors my program held (regardless if I call close(fd) of each file...
13
by: Jim Langston | last post by:
I had asked this in comp.lang.c++ with out any answers that would actually work, so I'm hoping someone here may know a way. I am calling C library functions that want to output to stdout. I need...
2
by: DJ Dharme | last post by:
Hi all, I am writing a multi-threaded application in c++ running on solaris. I have a file which is updated by a single thread by appending data into the file and at same time the other threads...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.