News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
sys.spawn / sys.pid question
Author Message
znarf
Junior Member
**


Posts: 34
Group: Registered
Joined: Jun 2007
Status: Offline
Reputation: 0
Post: #1
sys.spawn / sys.pid question

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

05-20-2008 08:15 PM
Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #2
RE: sys.spawn / sys.pid question

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)

05-21-2008 10:00 PM
Find all posts by this user Quote this message in a reply
jpjacobs
Member
***


Posts: 113
Group: Registered
Joined: Jul 2007
Status: Offline
Reputation: 0
Post: #3
RE: sys.spawn / sys.pid question

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?

05-22-2008 02:51 AM
Find all posts by this user Quote this message in a reply
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #4
RE: sys.spawn / sys.pid question

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

05-24-2008 03:28 PM
Visit this user's website Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #5
RE: sys.spawn / sys.pid question

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)

05-25-2008 01:12 PM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: