Hi,
A very simple solution is to check at the start or end of the main loop for the existence of a stop file. If found the program would then write away it's state to a file or DB ( I like SQLite too ).
Also delete the stop file as the first thing you do in the program.
Simple and easy to work/maintain.
J.C.
In reply to Re: Gracefully exiting and restarting at a later time.
by Anonymous Monk
in thread Gracefully exiting and restarting at a later time.
by Largins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |