Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: How to safely maintain a status file (http://www.velocityreviews.com/forums/t948069-re-how-to-safely-maintain-a-status-file.html)

Steven D'Aprano 07-13-2012 01:52 AM

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.


--
Steven


All times are GMT. The time now is 11:59 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.