W walmo Active Member Licensed User Longtime User Nov 27, 2018 #1 Hi I am writing string to a txt file every 3 minutes. But now getting some corrupted files when device battery flap or manual device restart when writing taking place. I've gotten a idea but don't know if it is the best way to do this. My idea is to.. write to file1 the string ... sleep 1 sec write to file2 the same string.... Now try to read file1 , on error catch with read file2... Do i need the sleep ? Is there a better way? Thanks
Hi I am writing string to a txt file every 3 minutes. But now getting some corrupted files when device battery flap or manual device restart when writing taking place. I've gotten a idea but don't know if it is the best way to do this. My idea is to.. write to file1 the string ... sleep 1 sec write to file2 the same string.... Now try to read file1 , on error catch with read file2... Do i need the sleep ? Is there a better way? Thanks
eps Expert Licensed User Longtime User Nov 27, 2018 #2 What are you using to read and write the files? Upvote 0
W walmo Active Member Licensed User Longtime User Nov 28, 2018 #3 Hi eps Using file.writestring / file.readstring Thanks Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Nov 28, 2018 #4 How does the file look after it became corrupted? Sounds to me that you should use KVS2 instead. Upvote 0