• 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: file changes content but ContentModificationDate not changing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file changes content but ContentModificationDate not changing


  • Subject: Re: file changes content but ContentModificationDate not changing
  • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Date: Wed, 05 Nov 2014 13:31:31 +0000

On 5 Nov 2014, at 13:13, Gerriet M. Denkmann <email@hidden> wrote:

> Any way to observe changes (except from polling, which I am trying to avoid)?

AFAICT ntpd doesn't write to this file, but rather writes to a temporary file and then replaces the original file with a temporary (using <x-man-page://2/rename>).  This is a pretty typical 'safe save' technique.

See save_drift_file in the following.

<http://www.opensource.apple.com/source/ntp/ntp-92/ntpd/ntp_util.c>

You can confirm this by checking the inode number of the file over time.

$ ls -li /var/db/ntp.drift
9615173 -rw-r--r--  1 root  wheel  9  4 Nov 09:46 /var/db/ntp.drift

It should change each time the file is saved.

If this is, indeed, how things work, you'll have to watch for changes to the parent directory and then check the file each time that directory changes.

                   *                   *                   *

Also, why do you care about this value?  This presence and format of this file isn't really considered API, so hard-coding that into an product that you ship to a wide variety of users would not be wise.  Perhaps there's a better approach?

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware



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

This email sent to email@hidden


  • Follow-Ups:
    • Re: file changes content but ContentModificationDate not changing
      • From: "Gerriet M. Denkmann" <email@hidden>
References: 
 >file changes content but ContentModificationDate not changing (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: file changes content but ContentModificationDate not changing
  • Next by Date: Re: file changes content but ContentModificationDate not changing
  • Previous by thread: file changes content but ContentModificationDate not changing
  • Next by thread: Re: file changes content but ContentModificationDate not changing
  • Index(es):
    • Date
    • Thread