Re: How to safely maintain a status file

Discussion in 'Python' started by Steven D'Aprano, Jul 13, 2012.

  1. 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
     
    Steven D'Aprano, Jul 13, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard Baron Penman

    How to safely maintain a status file

    Richard Baron Penman, Jul 8, 2012, in forum: Python
    Replies:
    0
    Views:
    208
    Richard Baron Penman
    Jul 8, 2012
  2. Dennis Lee Bieber

    Re: How to safely maintain a status file

    Dennis Lee Bieber, Jul 8, 2012, in forum: Python
    Replies:
    1
    Views:
    195
    Plumo
    Jul 9, 2012
  3. Laszlo Nagy

    Re: How to safely maintain a status file

    Laszlo Nagy, Jul 8, 2012, in forum: Python
    Replies:
    1
    Views:
    244
    Nobody
    Jul 9, 2012
  4. Plumo
    Replies:
    1
    Views:
    224
    Michael Hrivnak
    Jul 9, 2012
  5. Plumo
    Replies:
    1
    Views:
    220
    Laszlo Nagy
    Jul 12, 2012
Loading...

Share This Page