Re: getting file creation date from NTFS
Re: getting file creation date from NTFS
- Subject: Re: getting file creation date from NTFS
- From: Angelo Chen <email@hidden>
- Date: Sun, 23 May 2010 19:49:24 +0800 (HKT)
Hi Ken,
Thanks, that works, problem solved. FSGetCatalogInfo (&ref, kFSCatInfoCreateDate.. is a better option to obtain creation date when you need to get NTFS file's date too.
Thanks to all responded,
Angelo.
--- 2010年5月23日 星期日,Ken Thomases <email@hidden> 寫道﹕
寄件人: Ken Thomases <email@hidden>
主題: Re: getting file creation date from NTFS
收件人: "Angelo Chen" <email@hidden>
副本(CC): email@hidden
日期: 2010年5月23日,星期日,下午7:12
On May 23, 2010, at 5:33 AM, Angelo Chen wrote:
> I think FSGetCatalogInfo (&ref, kFSCatInfoCreateDate, &info, NULL, NULL, NULL); info.createDate has the creation date, can see it clearly in debugger, problem is, how to convert it into NSDate
You should use UCConvertUTCDateTimeToCFAbsoluteTime() and CFDateCreate(). Since CFDate is toll-free bridged with NSDate, you can just cast the result. (You do have to be mindful of memory-management issues, of course.)
You can also feed the CFAbsoluteTime value to +[NSDate dateWithTimeIntervalSinceReferenceDate:], since the reference date is the same between the two.
Regards,
Ken
_______________________________________________
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