Afficher un message
Vieux 16/09/2007, 20h20   #4
Tim Pease
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: loop a program on exit?

On 9/15/07, Michael Linfield <globyy3000@hotmail.com> wrote:
> i want to have a program restart when its closed via the X button on the
> window / terminal
>
> any ideas?
> --
> Posted via http://www.ruby-forum.com/.
>


at_exit {exec "ruby", $0, *ARGS}

Should work on all platforms, but you will not get the original flags
to the ruby interpreter. You should register a signal handler to trap
SIGKILL or SIGTERM and do an exit! from the handler. This will prevent
the at_exit blocks from running.

Blessings,
TwP

  Réponse avec citation
 
Page generated in 0,05492 seconds with 9 queries