Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

SOLVED (more or less) Re: Extract CTIME in zsh 4.2.3?




Yes, from my extensive testing of one FreeBSD system, one Linux (Gentoo) system, and one OS X system, there does not seem to be a consistent way of getting this information.

'stat' on OS X does not seem to store the created date. That killed the best chance for compatibility right there.

There are a couple of different ways to get it in OS X.

Tiger:
    mdls "${FILES}" | awk -F'"' '/kMDItemContentType /{print $2}'

gives me

    2005-08-20


If developer tools are installed:

/Developer/Tools/GetFileInfo "${FILES}" | awk -F' ' '/created: / {print $2}'

gives me

    08/20/2005

which isn't the format I wanted, so I'm sticking with 'mdls' for now.


Thanks to all who responded!

TjL




Messages sorted by: Reverse Date, Date, Thread, Author