Robert Klemme
9/17/2007 9:39:00 PM
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