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


Click here to return to the '10.3: ls date format switched from previous releases' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: ls date format switched from previous releases
Authored by: hopthrisC on Jan 20, '04 03:58:39PM
You are a "UNIX programmer"? Right... Look what the output of my ls looks like:
aschenputtel:~ hop$ ls -l
insgesamt 0
drwxr-xr-x    4 hop      hop           136 18. Jan 21:59 Applications
drwxr-xr-x    4 hop      hop           136 21. Jun 2003  CVS
drwx------   59 hop      hop          2006 20. Jan 00:49 Desktop
drwx------   23 hop      hop           782 18. Jan 20:48 Documents
drwx------   35 hop      hop          1190 20. Jan 21:47 Library
That is the output of GNU ls, granted, but to quote from the man page of BSD ls:
     LANG            The locale to use when determining the order of day and
                     month in the long -l format output.  See environ(7) for
                     more information.



[ Reply to This | # ]
10.3: ls date format switched from previous releases
Authored by: LC on Jan 20, '04 05:17:08PM
There actually is a dual-mode behavior to /bin/ls. I did a "strings" on the executable and found both
"%e %b" and "%b %e" in it ... then I looked at the FreeBSD source (of ls) and saw stuff like --
d_first = (*nl_langinfo(D_MD_ORDER) == 'd');
format = d_first ? "%e %b %Y " : "%b %e %Y ";
in it ... and in /usr/include/langinfo.h on your system, it'll say --
#define D_MD_ORDER 57 /* month/day order (local extension) */
So it has something to do with D_MD_ORDER in the locale; Larry.

[ Reply to This | # ]
10.3: ls date format switched from previous releases
Authored by: LC on Jan 20, '04 05:48:29PM
O.K. I think I get it now, md_order is defined in timedef of the locale source, for example --
#
# md_order
#
md

So, some of the locales in use probably have "dm" which is triggering that "d_first" in /bin/ls.
If I can dump 'em or figure out which one(s), I'll post here. Larry.

[ Reply to This | # ]
10.3: ls date format switched from previous releases
Authored by: LC on Jan 20, '04 06:11:37PM
I grep'ed all of the LC_TIME files under /usr/share/locale and most of them specify "dm"
as the month-date order, which is probably what's stimulating /bin/ls to do that. But the USA and Canada English
locales do specify "md". I checked both my Date (time zone) and International System Preferences panels and those
settings looked o.k.; so I'm still wondering which preference file is throwing off my current locale setting and so ls. Larry.

[ Reply to This | # ]
10.3: ls date format switched from previous releases
Authored by: fenner on Jan 20, '04 08:44:45PM

Due to a error introduced when porting the locale code, ls doesn't look at the order field; it always uses "dm". You're not going to find a preference to change it because it's a bug.



[ Reply to This | # ]