From: Robert Klemme Date: 2007-09-18T06:40:03+09:00 Subject: Re: loop a program on exit? On 17.09.2007 22:12, Michael Linfield wrote: > John Joyce wrote: > >> You're going into very platform specific territory there. Potentially >> malware like behavior. > > this is true, i do see how it could be seen as malware behavior and i > should probably stay away from that. Its purpose is to make sure the > user cannot exit while its running its given functions, if they were to > do this, it could cause some serious problems :( > > >> at_exit {exec "ruby", $0, *ARGS} > thanks Tim Pease ill look into that > >> END{ >> code >> } > > i will give that a shot as well Here's another mechanism: loop do Process.waitpid( fork do # your program goes here end ) end Kind regards robert