• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "Flushing" a rename?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Flushing" a rename?


  • Subject: Re: "Flushing" a rename?
  • From: Dominic Giampaolo <email@hidden>
  • Date: Tue, 13 May 2008 16:00:25 -0700

But I now have a second file that gets updated by writing the data a temporary file which replaces the original file via a rename. After the rename, how can I guarantee that all of the directory records associated with that file have been flushed to disk?

A rename is guaranteed to be atomic on hfs.  Either
it happens or it doesn't.  If the system crashes you
will either have the temp file and the original file
or you will have only the renamed file.

You should of course fsync() the temp file before you
close it and do the rename.


--dominic

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >"Flushing" a rename? (From: James Bucanek <email@hidden>)

  • Prev by Date: "Flushing" a rename?
  • Next by Date: Re: "Flushing" a rename?
  • Previous by thread: "Flushing" a rename?
  • Next by thread: Re: "Flushing" a rename?
  • Index(es):
    • Date
    • Thread