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 <k...@codeweavers.com> 寫道﹕
寄件人: Ken Thomases <k...@codeweavers.com> 主題: Re: getting file creation date from NTFS 收件人: "Angelo Chen" <angelochen...@yahoo.com.hk> 副本(CC): cocoa-dev@lists.apple.com 日期: 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 (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com