So I’ve done some work: 1. Might be possible no kMDItemLastUsedDate on a new Mac after using MigrationAssistant or of course if no Spotlight being used 2. NSURLContentAccessDateKey returns the current date like mentioned here - http://stackoverflow.com/questions/13914600/get-the-real-last-opened-date <http://stackoverflow.com/questions/13914600/get-the-real-last-opened-date> 3. The same problem with st_atimespec it returns the current date 4. NSURLAttributeModificationDateKey seems to be what Path Finder is using to get the Attribute tag
So from what I see there is no real alternative to kMDItemLastUsedDate if that value is missing. Additional thoughts? > On 15 Mar 2016, at 1:04 AM, Fritz Anderson <fri...@manoverboard.org> wrote: > > >> On 14 Mar 2016, at 10:39 AM, Jens Alfke <j...@mooseyard.com> wrote: >> >> Unix filesystems do keep a last-accessed date for files, but it looks like >> NSFileManager doesn’t expose an attribute for it. You can call stat() and >> get the st_atimespec field of the result. > > NSURL *Resource* methods can get at NSURLContentAccessDateKey: > >> The time at which the resource was most recently accessed, returned as an >> NSDate object if the volume supports accessdates, or nil if access dates are >> unsupported (read-only). > > The resource stuff is painful, especially in Swift, but indispensable. > > — F > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com