Hey guys. My program does long runs, and generates too much data to store as it goes along. It typically saves the info at the end, when it's done. However, sometimes we decide that it has run enough in the middle, and kill it. But then we lose all the data.
How can I handle SIGINT so that I can at least dump the data I have so far to a file?