PDA

View Full Version : File execute that does not exit?



Bjarredsbon
December 30th, 2008, 05:42 PM
Hey,

I am using the RRD toolkit (h t t p://oss.oetiker.ch/rrdtool/) and need a way to priodically submit data to RRD.

Currently I use "os.execute()" to do this. But I cannot avoid a msdos cmd window to pop up and steal focus. Can this be fixed?

If not, there is a second (and better) way. This solution is to only call the RRD program once, and have it listen to stdin for updates.

But is it possible to open a command and then row-by-row submit more stdin data to this "socket"? os.execute clearly does not do this, as it is a one-shot function. Instead I am looking for something that mimics a socket, with calls to submit new data and callback function when new data is received.

But I cannot find any such support in Girder (4)? Please point me in the right direction, or suggest which solution to use!

Many thanks,
Peter

Rob H
December 31st, 2008, 07:53 AM
Rather than using os.execute() take a look in the help for win.ShellExecute (or possibly win.ShellExecuteEx)

Bjarredsbon
December 31st, 2008, 08:21 AM
Thanks. This seem to help alternative 1 above. I will try this

But I consider solution 2 better - any suggestions on how to pass more data to the program at a later stage?

Thanks,
Peter


Rather than using os.execute() take a look in the help for win.ShellExecute (or possibly win.ShellExecuteEx)