Re: getting last accessed date

2011-07-14 Thread Rick C.
Hi again, Ok I seem to be having never ending problems here unfortunately. Using this code (below) I thought I could modify it for my needs. But on the FSPathMakeRef line I keep getting the warning that pointer targets in passing argument 1 of 'FSPathMakeRef' differ in signedness. Would

Re: getting last accessed date

2011-07-14 Thread Matt Gough
But on the FSPathMakeRef line I keep getting the warning that pointer targets in passing argument 1 of 'FSPathMakeRef' differ in signedness. Would someone mind telling me why I'm getting this error? Thanks you very much! Because FSPathMakeRef takes a UInt8* as its first parameter, while

Re: getting last accessed date

2011-07-10 Thread Rick C.
Great thanks I will look into this! On Jul 9, 2011, at 3:40 PM, Gary L. Wade wrote: Using Core Services or OS, you can call FSGetCatalogInfo. Also, I recall things are different for stat under 64 bit, so you may want to make sure you're doing the right thing. - Gary L. Wade (Sent from

Re: getting last accessed date

2011-07-09 Thread Gary L. Wade
Using Core Services or OS, you can call FSGetCatalogInfo. Also, I recall things are different for stat under 64 bit, so you may want to make sure you're doing the right thing. - Gary L. Wade (Sent from my iPhone) On Jul 8, 2011, at 8:37 PM, Rick C. rickcort...@gmail.com wrote: Ok I have

Re: getting last accessed date

2011-07-08 Thread Rick C.
Well I am using iconForFile if I remember correctly. Since I'm on the iPhone let me double-check everything you all have suggested and I'll post back. Thanks again! rc On Jul 8, 2011, at 1:52 PM, Stephen J. Butler stephen.but...@gmail.com wrote: On Fri, Jul 8, 2011 at 12:31 AM, Scott

Re: getting last accessed date

2011-07-08 Thread Rick C.
Sorry about that no I'm on Mac OS I was just sending the email from my iPhone :-) Ok I double-checked and I think I am getting the same results as you are. But iconForFile does not modify the Last Opened date that shows in Finder. So the question is how do I get that besides using the

Re: getting last accessed date

2011-07-08 Thread Chris Ridd
On 8 Jul 2011, at 09:54, Rick C. wrote: Sorry about that no I'm on Mac OS I was just sending the email from my iPhone :-) Ok I double-checked and I think I am getting the same results as you are. But iconForFile does not modify the Last Opened date that shows in Finder. So the

Re: getting last accessed date

2011-07-08 Thread Rick C.
I'll have to check this Chris. And actually I can disable the icon fetching for testing purposes. The main thing is I have a list of files which I want to show the equivalent of Last Opened date in Finder. I'll post back about this thanks! On Jul 8, 2011, at 5:38 PM, Chris Ridd wrote:

Re: getting last accessed date

2011-07-08 Thread Rick C.
Ok I have double-checked and the icon isn't actually the issue since I call iconForFile: after using stat. With the original code I posted it just gives me today's date. I can go into Finder and as an example I found a file that has a Last Opened date of 2009 and when I run stat it gives me

getting last accessed date

2011-07-07 Thread Rick C.
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];

Re: getting last accessed date

2011-07-07 Thread Scott Ribe
On Jul 7, 2011, at 9:35 PM, Rick C. wrote: But it's just giving me today's date. There must be something obvious... Are you sure the last access time is not today? There, how was that for obvious ;-) -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice

Re: getting last accessed date

2011-07-07 Thread Joar Wingfors
Hello Rick, The access date on a file is updated very frequently. I think that stat:ing the file is enough, and that happens all the time. If what you're looking for is the last *opened* date of the file, I think that your best bet is the kMDItemLastUsedDate spotlight metadata attribute. j o

Re: getting last accessed date

2011-07-07 Thread Rick C.
Thanks for the replies and yeah I get what you're saying. The only thing with the spotlight metadata is it will depend on the spotlight index being enabled correct? And yes it is the opened date I'm looking for. One more note, seems in terminal stat aFile works so I suppose I could use

Re: getting last accessed date

2011-07-07 Thread Scott Ribe
On Jul 7, 2011, at 11:19 PM, Rick C. wrote: One more note, seems in terminal stat aFile works so I suppose I could use nstask to do this as well? It does seem odd that the two would produce different results... -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303)

Re: getting last accessed date

2011-07-07 Thread Stephen J. Butler
On Fri, Jul 8, 2011 at 12:31 AM, Scott Ribe scott_r...@elevated-dev.com wrote: On Jul 7, 2011, at 11:19 PM, Rick C. wrote: One more note, seems in terminal stat aFile works so I suppose I could use nstask to do this as well? It does seem odd that the two would produce different results...