Murga-Projects Forums
sys.spawn / sys.pid question - Printable Version

+- Murga-Projects Forums (http://www.murga-projects.com/forum)
+-- Forum: Project Forums (/forumdisplay.php?fid=1)
+--- Forum: MurgaLua - General (/forumdisplay.php?fid=2)
+--- Thread: sys.spawn / sys.pid question (/showthread.php?tid=320)


sys.spawn / sys.pid question - znarf - 05-20-2008 08:15 PM

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


RE: sys.spawn / sys.pid question - mikshaw - 05-21-2008 10:00 PM

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)


RE: sys.spawn / sys.pid question - jpjacobs - 05-22-2008 02:51 AM

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?


RE: sys.spawn / sys.pid question - JohnMurga - 05-24-2008 03:28 PM

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


RE: sys.spawn / sys.pid question - mikshaw - 05-25-2008 01:12 PM

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)