Re: [Moderator] Re: getting file creation date from NTFS

2010-05-24 Thread Paul Sanders
PM Subject: [Moderator] Re: getting file creation date from NTFS On May 24, 2010, at 5:52 AM, Paul Sanders wrote: >> Let's take it off list then, rather than posting off-topic >> stuff to cocoa-dev? > > What for? The list is for the discussion of cocoa development issues of

[Moderator] Re: getting file creation date from NTFS

2010-05-24 Thread Scott Anguish
On May 24, 2010, at 5:52 AM, Paul Sanders wrote: >> Let's take it off list then, rather than posting off-topic >> stuff to cocoa-dev? > > What for? The list is for the discussion of cocoa development issues of a technical issue. At this point, it isn’t. Alastair is correct in asking that thi

[OT] Re: getting file creation date from NTFS

2010-05-24 Thread Alastair Houghton
On 24 May 2010, at 10:52, Paul Sanders wrote: >> Let's take it off list then, rather than posting off-topic >> stuff to cocoa-dev? > > What for? Because it chokes the list up with things that other people (who are interested in *COCOA*) are not interested in, that's "what for". > As far as I

Re: getting file creation date from NTFS

2010-05-24 Thread Paul Sanders
> Let's take it off list then, rather than posting off-topic > stuff to cocoa-dev? What for? As far as I'm concerned, we are done. I just don't like ill-informed 'Windows bashing', any more than you would like it if I took a pop at something I didn't understand on the Mac. I am not a Window

Re: getting file creation date from NTFS

2010-05-24 Thread Alastair Houghton
On 24 May 2010, at 10:42, Paul Sanders wrote: > > The docs don't really *have to* say, though, because it's the only choice > > that makes any sense. > > Of course they do. Ambiguity like this just leads to confusion. And I know > it's off topic, Let's take it off list then, rather than post

Re: getting file creation date from NTFS

2010-05-24 Thread Paul Sanders
> The docs don't really *have to* say, though, because it's the only choice > that makes any sense. Of course they do. Ambiguity like this just leads to confusion. And I know it's off topic, but I can't let your assertion that "Windows actually bases everything off local time" pass without co

Re: getting file creation date from NTFS

2010-05-23 Thread Alastair Houghton
On 23 May 2010, at 21:21, Paul Sanders wrote: >> On sensible platforms, stat() returns UTC, as you'd expect. > > That statement I can now verify by experiment (which is good as I assumed > that when I wrote the code). The docs do not say. OS X conforms to the SUSv3 specification, which says ex

Re: getting file creation date from NTFS

2010-05-23 Thread Paul Sanders
> BTW, why "hazard a guess" rather than either (a) testing this, or (b) looking > at the kernel sources to find out? Because I thought it might be a useful heads-up for the OP. I am not planning on using this API myself and I am not familiar with the kernel sources. > On sensible platforms, st

Re: getting file creation date from NTFS

2010-05-23 Thread Alastair Houghton
On 23 May 2010, at 19:07, Paul Sanders wrote: > > At the BSD layer, getattrlist() is the way to go here, with the > > ATTR_CMN_CRTIME attribute. > > From > http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man2/getattrlist.2.html: > > "Not all volumes support geta

Re: getting file creation date from NTFS

2010-05-23 Thread Paul Sanders
> At the BSD layer, getattrlist() is the way to go here, with the > ATTR_CMN_CRTIME attribute. >From >http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man2/getattrlist.2.html: "Not all volumes support getattrlist(). The best way to test whether a volume supports

Re: getting file creation date from NTFS

2010-05-23 Thread Alastair Houghton
On 23 May 2010, at 18:39, Paul Sanders wrote: >> Yes, although the stat structure only has the st_birthtimespec field if you >> build with 64-bit inodes enabled. This is the default on Snow Leopard or >> for 64-bit, but not for 32-bit on Leopard or earlier. > > I'm not certain, but I think you

Re: getting file creation date from NTFS

2010-05-23 Thread Paul Sanders
> Yes, although the stat structure only has the st_birthtimespec field if you > build with 64-bit inodes enabled. This is the default on Snow Leopard or > for 64-bit, but not for 32-bit on Leopard or earlier. I'm not certain, but I think you have to use stat64 in 32 bit Leopard builds to get st

Re: getting file creation date from NTFS

2010-05-23 Thread Angelo Chen
ting file creation date from NTFS 收件人: "Angelo Chen" 副本(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 cre

Re: getting file creation date from NTFS

2010-05-23 Thread Ken Thomases
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 UCConvertUTCDateTimeToCFAbsoluteT

Re: getting file creation date from NTFS

2010-05-23 Thread Angelo Chen
oid NSDateToUTCDateTime( NSDate* date, UTCDateTime *utc ){     *(unsigned long long*)utc = ([date timeIntervalSinceReferenceDate] - CarbonReferenceDate()) * 65536.0;} --- 2010年5月23日 星期日,Ken Thomases 寫道﹕ 寄件人: Ken Thomases 主題: Re: getting file creation date from NTFS 收件人: "Paul Sanders"

Re: getting file creation date from NTFS

2010-05-23 Thread Ken Thomases
On May 23, 2010, at 4:19 AM, Paul Sanders wrote: > Assuming that these figures come from stat (man -S 2 stat for details), it > should be in something called st_birthtime. Yes, although the stat structure only has the st_birthtimespec field if you build with 64-bit inodes enabled. This is the

Re: getting file creation date from NTFS

2010-05-23 Thread Paul Sanders
st_flags = 0x st_gen = 0 --- 2010年5月23日 星期日,Paul Sanders 寫道﹕ 寄件人: Paul Sanders 主題: Re: getting file creation date from NTFS 收件人: "Ken Thomases" , "Angelo Chen" 副本(CC): cocoa-dev@lists.apple.com 日期: 2010年5

Re: getting file creation date from NTFS

2010-05-22 Thread Angelo Chen
(Wed Aug  4 04:56:56 2004)     st_ctime   = 1274540319.708286000 (Sat May 22 14:58:39 2010)    st_size    = 69120 (67 KB)    st_blocks  = 136    st_blksize = 33554432    st_flags   = 0x    st_gen     = 0 --- 2010年5月23日 星期日,Paul Sanders 寫道﹕ 寄件人: Paul Sanders 主題: Re: getting file creation

Re: getting file creation date from NTFS

2010-05-22 Thread Paul Sanders
> Also be aware that not all file systems support the notion of > creation dates of their objects. I don't know off-hand if > NTFS does. It does. Paul Sanders. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requ

Re: getting file creation date from NTFS

2010-05-22 Thread Ken Thomases
On May 22, 2010, at 10:33 AM, Angelo Chen wrote: > I'd like to get creation date of a file, here are the codes: Since there seems to be a bug with Cocoa (that you should file at ), you may wish to try stat(2) or perhaps FSGetCatalogInfo(). For stat(2), if you're tar

Re: getting file creation date from NTFS

2010-05-22 Thread Hank Heijink (Mailinglists)
On May 22, 2010, at 11:33 AM, Angelo Chen wrote: > Hi, > I'd like to get creation date of a file, here are the codes: > NSDictionary *fileAttributes = [fileManager fileAttributesAtPath:path > traverseLink:YES]; NSLog(@"Dict %@", fileAttributes); > This works if the file came from FAT or Mac

getting file creation date from NTFS

2010-05-22 Thread Angelo Chen
Hi, I'd like to get creation date of a file, here are the codes: NSDictionary *fileAttributes = [fileManager fileAttributesAtPath:path traverseLink:YES];NSLog(@"Dict %@", fileAttributes); This works if the file came from FAT or Mac OS X, but if it is in a NTFS volume, creation date is alw