• 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 HFS cache to disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: flushing HFS cache to disk


  • Subject: Re: flushing HFS cache to disk
  • From: Steve Sisak <email@hidden>
  • Date: Wed, 30 Nov 2005 22:16:46 -0500

At 6:27 PM -0800 11/30/05, Dave Yost wrote:
I suppose you could write the file as a temp file, do a synchronous flush of the file, then move it into place. This is of course, a hack on top of an API that was never designed to be transactional.

And of course, this is exactly how an HFS "safe save" works on "traditional" MacOS:


FindFolder() to get the dirID of the invisible "Temporary Items" folder on the same volume as the destination file

Create and write to a temporary file

FSpExchangeFiles() to atomically swap the contents of the files (by swapping their directory entries) -- this preserves the fileID so aliases still work.

Delete the temp file (which is now the old file)

And you could still end up with a temp file lying around after a crash.

On reboot, any files left in "Temporary Items" are moved to "Rescued Items", located in the Trash.


Years ago there was a Cromemco unix clone that let you create a file descriptor, write to it, then link it into a directory. That was a good idea that was rejected as unorthodox.

Gotta love religion.

Cheers,

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


References: 
 >Re: flushing HFS cache to disk (From: Mark Day <email@hidden>)
 >Re: flushing HFS cache to disk (From: Shawn Erickson <email@hidden>)
 >Re: flushing HFS cache to disk (From: Dave Yost <email@hidden>)
 >Re: flushing HFS cache to disk (From: Peter Bierman <email@hidden>)
 >Re: flushing HFS cache to disk (From: "Timothy J. Wood" <email@hidden>)
 >Re: flushing HFS cache to disk (From: Dave Yost <email@hidden>)

  • Prev by Date: Re: flushing HFS cache to disk
  • Previous by thread: Re: flushing HFS cache to disk
  • Next by thread: AVC/H.264 ISMACryp
  • Index(es):
    • Date
    • Thread