• 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: Veracity of "attributes modified" date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Veracity of "attributes modified" date


  • Subject: Re: Veracity of "attributes modified" date
  • From: James Bucanek <email@hidden>
  • Date: Mon, 24 Sep 2012 10:12:00 -0700

James Bucanek <mailto:email@hidden> wrote (Wednesday, September 19, 2012 6:30 PM -0700):

Question: What filesystem object metadata changes will cause the 'attribute
change time' (ATTR_CMN_CHGTIME) property to be updated?

I found what appeared to be a definitive answer in stat(2):

    st_ctime
    "Time when file status was last changed (inode data modification).
    Changed by the chmod(2), chown(2), link(2), mknod(2), rename(2)**,
    unlink(2), utimes(2) and write(2) system calls."

** rename() does NOT change the ctime attribute of the file being renamed.
       It does change the ctime of its parent directory.

Through empirical testing, I've also determined that the ctime attribute is updated by:

    chflags()
    setxattr()/removexattr()
    acl_set_*().

The later two is what I was really interested in knowing, because getting the ACLs and extended attributes for a file is a pretty expensive operation. Much easier to look for changes by comparing ctimes.

Indirectly, changes to things like the item's Finder label, script hint, icon position, and so on also modify the ctime because these are now stored in the com.apple.FinderInfo extended attribute.

--
James Bucanek


_______________________________________________
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: 
 >Veracity of "attributes modified" date (From: James Bucanek <email@hidden>)

  • Prev by Date: Disk Utility software RAID 1
  • Next by Date: Is statfs.f_bsize available through getattrlist()?
  • Previous by thread: Veracity of "attributes modified" date
  • Next by thread: Disk Utility software RAID 1
  • Index(es):
    • Date
    • Thread