Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Yes, touch, but it needs stat' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Yes, touch, but it needs stat
Authored by: el bid on Jan 14, '02 01:47:20PM

I was pained to discover from this report that stat isn't installed on MacOS X by default. And it's not in the Darwin Tools update from darwin.org either (probably because stat comes from SySV rather than BSD). Without stat you can't (as far as I know -- anyone?) get full file date info from the command line.

Happily you can get the binary + man page from http://gnu-darwin.sourceforge.net/packages/pseudo2/sysutils.

--
el bid



[ Reply to This | # ]
Yes, touch, but it needs stat
Authored by: bhines on Jan 15, '02 09:24:06AM

use GetFileInfo to get a file's mod times. It is in /Developer/Tools/

-B



[ Reply to This | # ]
Yes, touch, but it needs stat
Authored by: el bid on Jan 16, '02 03:52:04AM

Thanks for that good info. Although as an old UNIX guy I can't seem to get used to the idea of utils that are off the standard paths and have long filenames with mixed case. :-)

GetFileInfo does do the job in this case (deliver the creation date, which stat calls the Changed date). But interestingly it doesn't give you the Accessed date, although you do get a bunch of other HFS+ stuff like Creator and Type and that amazing list of one char attribute flags, including a special flag to indicate whether a file is on the Desktop or not (eh?).

Strangely GetFileInfo doesn't understand file globbing. Ask it to return a list of information on files matching orb*, for example, and it barfs.

--
el bid



[ Reply to This | # ]