Re: question about last used date
Re: question about last used date
- Subject: Re: question about last used date
- From: "Rick C." <email@hidden>
- Date: Tue, 15 Mar 2016 09:11:38 +0800
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 <email@hidden> wrote:
>
>
>> On 14 Mar 2016, at 10:39 AM, Jens Alfke <email@hidden> 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 (email@hidden)
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:
This email sent to email@hidden