10-24-2006 10:22 AM
10-24-2006 10:44 AM
How fast is your sampling rate? If not too fast then you can open the file, write the data, and close the file. Repeat for each sample. This would minimize the opportunity for a file to be corrupted. But if power outage arrives while file is open you may lose data or corrupt the file.
Ideally, get an uninterruptable power supply with enough capacity to power your system for as long as needed. Of course if power is off then the data you are collecting may be useless if whatever you are monitoring looses power.
10-24-2006 11:19 AM
10-24-2006 12:03 PM
There's a whole lot of possibilites
If you have a UPS, then you can probably monitor it for when it switches to battery. Immediately close and save the file.
You should probably be writing to a series of files instead of the same one. Switch files periodically so that you have at least some data saved.
Don't write to a text file. Instead write to a database on a server that is well protected by a UPS. Even if you open and close the database connection with every write, I don't think that will take much longer than writing to a text file. Choose a robust datadase such as SQL Server, Oracle, or MySQL and get your IS department to help.
10-24-2006 12:09 PM
10-24-2006 07:49 PM
10-25-2006 11:07 AM
I'd like to thank you all for this tips. I've tested some of them and I'm going to use the flush file function and create a backup file.
Thanks again
Juliana
11-01-2006 01:38 AM
11-01-2006 08:58 AM
11-01-2006 09:16 AM