• 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: Mark Day <email@hidden>
  • Date: Tue, 29 Nov 2005 13:32:44 -0800

On Nov 29, 2005, at 12:03 PM, email@hidden wrote:

that's what sync(2) does.

It doesn't seem to.

Beware that sync(2) is an asynchronous call. It just begins the flushing of data to all volumes. If you're reading the disk immediately, the changes may not have been written yet.



What information in particular do you not think is getting flushed to disk.

E.g. when I delete a file this change is not written to the HFS catalog tree after calling sync() - the tree still contains this entry.

And why in the world are you accessing the filesystem through the
raw device instead of the mounted filesystem. Even if you sync(2),
you're never going to get a coherent snapshot of the filesystem that
is mounted read/write.

I need to get a list of all files with related information. Reading this list from the HFS catalog tree is much faster than looping and stat-ing through all directories (e.g. with 500.000 entries: seconds compared to minutes) - while both will not result in a coherent snapshot.

Have you tried FSCatalogSearch or PBCatSearch in Carbon, or searchfs (2) at the BSD layer? On HFS, they end up reading the catalog B-tree in file order, not in hierarchical order. (That's probably what your code is trying to do.) Note that these calls aren't supported on all volume formats.


-Mark

_______________________________________________
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


  • Follow-Ups:
    • Re: flushing HFS cache to disk
      • From: Dave Yost <email@hidden>
  • Prev by Date: Re: flushing HFS cache to disk
  • Next by Date: Leaf vs. Non-leaf functions & crash reporting
  • Previous by thread: Re: flushing HFS cache to disk
  • Next by thread: Re: flushing HFS cache to disk
  • Index(es):
    • Date
    • Thread