• 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: Don Brady <email@hidden>
  • Date: Tue, 29 Nov 2005 14:06:42 -0700


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

At 9:39 Uhr -0800 29.11.2005, Shantonu Sen wrote:
that's what sync(2) does.

It doesn't seem to.


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.


If you just need to search the catalog why not use searchfs(2) or the related Carbon call (PBCatSearch)?

-Don


Shantonu

On Nov 29, 2005, at 2:38 AM, email@hidden wrote:

In order to read _current_ HFS data from a mounted disk we need to flush the HFS cache to disk before we start to read.

- Calling sync() does not do the job - data on disk is not updated with HFS cache.
- Opening the disk with open("/dev/rdsk0s10", O_RDWR) or (open ("/", O_RDWR) and calling fsync(diskfd) or ioctl(diskfd, DKIOCSYNCHRONIZECACHE) does not do it - data on disk is not updated with HFS cache.
- Starting Disk Utility does the job - afterwards the HFS data on disk is updated with current information.


Any idea how Disk Utility forces to flush the HFS cache to disk, and how we can do it in our code (without having to start Disk Utility ;-))?

Thanks,

Uwe Gohlke
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40opendarwin.org


This email sent to email@hidden


Uwe Gohlke
_______________________________________________
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

_______________________________________________ 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: 
 >flushing HFS cache to disk (From: email@hidden)
 >Re: flushing HFS cache to disk (From: Shantonu Sen <email@hidden>)
 >Re: flushing HFS cache to disk (From: email@hidden)

  • Prev by Date: Re: flushing HFS cache to disk
  • Next by Date: Re: flushing HFS cache to disk
  • Previous by thread: Re: flushing HFS cache to disk
  • Next by thread: Re: flushing HFS cache to disk
  • Index(es):
    • Date
    • Thread