Murga-Projects Forums

Full Version: sys.spawn / sys.pid question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all,

I'm currently trying to run an external console application as a background job started from a murgaLua script using the features provided by the luasys package in murgaLua 0.6.8.
I did not yet succeed in checking the status of a spawned process. I did the following:

local pid = sys.pid()
sys.spawn(app, nil, pid)

now I miss something like pid:status() which I could loop over in order to determine the present process status.

Any idea how to do this would be warmly welcome.

Thanks and regards,
Gerald
What I'm curious about is the fact that it's a console application. Unless you're running murgaLua in the same shell as the spawned application, it appears that the pid you'd get is from the terminal itself, and I don't see how it would be possible to retrieve any status from the app without using a middle man temp file. I've tried a number of times to simply get the exit status of an application run in a terminal, and still can't do that.

I might have misunderstood you, of course, and it's possible that I'm completely wrong about the pid =o)

znarf Wrote:
Hello all,

I'm currently trying to run an external console application as a background job started from a murgaLua script using the features provided by the luasys package in murgaLua 0.6.8.
I did not yet succeed in checking the status of a spawned process. I did the following:

local pid = sys.pid()
sys.spawn(app, nil, pid)

now I miss something like pid:status() which I could loop over in order to determine the present process status.

Any idea how to do this would be warmly welcome.

Thanks and regards,
Gerald



Second that... some docs on the whole lua-sys thing would be nice... I really can't deduce the whole workings just from the example files.

Thx
PS: tried 'return pid' maybe that returns something usefull?

Sorry ... I am in Fiji right now ... And although my lady has allowed me 15mins in the internet cafe it is not going to be enough :-(

I'll be back in about a week ...

SORRY

Quote:
And although my lady has allowed me 15mins in the internet cafe

Well, let's hope the reason is she just wants you back to the hotel with her for a cuddle =o)

Reference URL's