• 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
getting last accessed date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getting last accessed date


  • Subject: getting last accessed date
  • From: "Rick C." <email@hidden>
  • Date: Fri, 08 Jul 2011 11:35:33 +0800

Hi again,

I'm using this code to get the last accessed date of a file:

struct stat output;

    int ret = stat([aFile fileSystemRepresentation], &output);
    struct timespec accessTime = output.st_atimespec;
   NSDate *aDate = [NSDate dateWithTimeIntervalSince1970:accessTime.tv_sec];

    NSLog(@"Access Time %d, %@",ret, aDate);

But it's just giving me today's date.  There must be something obvious I'm doing wrong but I have not been able to figure it out.  Any pointers?  And I couldn't use NSURLContentAccessDate because I still need 10.5 support.  Thanks!

rc_______________________________________________

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: getting last accessed date
      • From: Joar Wingfors <email@hidden>
    • Re: getting last accessed date
      • From: Scott Ribe <email@hidden>
  • Prev by Date: Re: linking the same static library into two places
  • Next by Date: Re: getting last accessed date
  • Previous by thread: NSPopupbutton binding setter getter....
  • Next by thread: Re: getting last accessed date
  • Index(es):
    • Date
    • Thread