Wolfsnap
Newcomer
I'm writing an application (controlling a piece of machinery) that records an event history and saves the event history as a text file each time an event occurs (machine started, machine stopped, etc.). I'm saving the files with current date as the filename. No problems yet, until the day changes. Then I want to clear the text and start a new file for the new day - but there's no way of knowing if the machine will be on right at midnight or knowing when it will be shut down the previous day.
This isn't too much a problem for someone who shuts the machine off at 5PM and back on at 8AM - it loads the days event history or creates a new one when the system starts. The problem is with the guy who runs the machine 24/7. An event occurs at 11:59 and gets saved, then another event happens at 12:01 and gets saved to a new day's file, but with all of the previous day's events. There's probably a simple solution, but it's confusing the tar out of me.
HELP!
This isn't too much a problem for someone who shuts the machine off at 5PM and back on at 8AM - it loads the days event history or creates a new one when the system starts. The problem is with the guy who runs the machine 24/7. An event occurs at 11:59 and gets saved, then another event happens at 12:01 and gets saved to a new day's file, but with all of the previous day's events. There's probably a simple solution, but it's confusing the tar out of me.
HELP!