Re: How to safely maintain a status file
On Thu, 12 Jul 2012 15:05:26 +0200, Christian Heimes wrote:
> You need to flush the data to disk as well as the metadata of the file
> and its directory in order to survive a system crash. The close()
> syscall already makes sure that all data is flushed into the IO layer of
> the operating system.
And some storage devices (e.g. hard drives, USB sticks) don't actually
write data permanently even when you sync the device. They just write to
a temporary cache, then report that they are done (liar liar pants on
fire). Only when the cache is full, or at some random time at the
device's choosing, do they actually write data to the physical media.
The result of this is that even when the device tells you that the data
is synched, it may not be.
|All times are GMT. The time now is 06:19 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.