• 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: question about last used date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: question about last used date
      • From: Jens Alfke <email@hidden>
References: 
 >question about last used date (From: "Rick C." <email@hidden>)
 >Re: question about last used date (From: Jens Alfke <email@hidden>)
 >Re: question about last used date (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Making Managed Object Context available to array controller in Storyboard scene
  • Next by Date: Re: question about last used date
  • Previous by thread: Re: question about last used date
  • Next by thread: Re: question about last used date
  • Index(es):
    • Date
    • Thread