Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
How do I properly spawn an external process on OS X from Ruby?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Paul Stickney, post: 4553953"] You can do something like... Fork. In the child, detach and exec (some people call for a double-fork). In the server, store the PID of the child to a file (if needed). To find out of the process is alive, send signal 0 to the saved ID. [There isn't really a signal 0 but trying to send on will let you know if a process with that ID is alive.] This works fine on systems that support `fork' and signals nicely so, not windows. You might be able to glean more interesting tidbits from Proc::Daemon on CPAN (yes, it's Perl). There are likely similar libraries for Ruby but I haven't looked (try RAA/rubyforge as usual...) Paul [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
How do I properly spawn an external process on OS X from Ruby?
Top