|
-
Jul 26th, 2006, 04:39 AM
#1
[02/03] Disk Caching
Its not often I ask a question, and even less often when I get a decent response .
Heres my dilema. I write to a file on shutdown of my app, due to the wonders of caching on laptops, I write to one filename, then rename it after to ensure my original file, removed just before rename of new file, is fully writen to disk. So I thought anyway.
On the shutdown of one server, it writes the file to disk, does the rename as it should. However the file itself is the correct size, but full of 0s. It has been renamed to my new file, so as far as my app is aware everything is great.
So I have 2 theories:
It has cached before writing it, and not ever finished it. And cached a rename which was sucessfull
or
It renamed it while being cached so didnt have time to fill it.
This has only happened twice, and the app backs itself up so we can nearly always bring it back without data loss.
So based on my theories, is there a way to force a write (ie wait for full write), or has anyone else solved this with a different method.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|