10.3: ls date format switched from previous releases

Jan 20, '04 09:51:00AM

Contributed by: dsquared

I am a UNIX programmer. Some time ago, I found a need to create a utility that would filter the results of the ls command by date. It is actually a combination of a bourne shell script and a C++ program which filters the output of the ls command by date or date range. This has worked for me for quite a long time from A/UX 3, through HP/UX 9 and 10, AIX 4 and Mac OS X 10.2. Strangely it is now broken in Mac OS X 10.3, Panther. The reason is a completely unnecessary change to the formatted output of the ls command. On Jaguar, 10.2.8, the ls output looks like:

  drwxr-xr-x   5 root      admin      170 Dec 26 21:36 grp
while on Panther it looks like:
  drwxr-xr-x   5 root      admin      170 26 Dec 21:36 grp
For reasons unknown, someone at Apple decided to reverse the order of the month and the day. As I said, I have not seen this on four other UNIXs nor one previous version of Mac OS X. It is apparently not related to the International settings in System Preferences (both were set to United States), nor is it related to a brand new machine (my iMac is less than a month old and came with 10.3.1), nor the installation of 10.3 over an existing 10.2.8 on a friend's Mac.

For those like me out there who have various utilities that utilize the dates output by the ls command, Apple has generated some unnecessary work for us. Beware, there may be other hidden oddities as well.

Comments (14)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040104152157563