Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Oct 2003 20:11:45 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Jan Stocker <Jan.Stocker@t-online.de>
Cc:        current@FreeBSD.org
Subject:   Re: ls -c  /  ls -u  doesn't work anymore
Message-ID:  <20031005195838.U4269@gamplex.bde.org>
In-Reply-To: <1065345238.611.7.camel@Twoflower.liebende.de>
References:  <1065247839.598.2.camel@Twoflower.liebende.de>  <20031004041941.Q37047-100000@sigma.freebsdhackers.net> <1065345238.611.7.camel@Twoflower.liebende.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 5 Oct 2003, Jan Stocker wrote:

> Newest world/kernel.... same prob
>
> jstocker@Twoflower:~ # mkdir x
> jstocker@Twoflower:~ # cd x
> jstocker@Twoflower:~/x # touch b-first; sleep 60
> jstocker@Twoflower:~/x # touch c-second; sleep 60
> jstocker@Twoflower:~/x # touch a-third
> jstocker@Twoflower:~/x # ls -l -c
> total 0
> -rw-r--r--  1 jstocker  jstocker  0  5 Oct 11:10 a-third
> -rw-r--r--  1 jstocker  jstocker  0  5 Oct 11:08 b-first
> -rw-r--r--  1 jstocker  jstocker  0  5 Oct 11:09 c-second
>
>
> looks very alphabetic....

-c and -u only work when combined with -t.  This may be bogus, but it
is no different than in 4.4BSD-Lite2 and it is specified by POSIX
(POSIX.1-200x-draft7:

21836                 -c            Use time of last modification of the file status information (see <sys/stat.h> in the
21837                               System Interfaces volume of IEEE Std 1003.1-200x) instead of last modification of
21838                               the file itself for sorting (-t) or writing (-l).
21864                 -u            Use time of last access (see <sys/stat.h> in the System Interfaces volume of
21865                               IEEE Std 1003.1-200x) instead of last modification of the file for sorting (-t) or
21866                               writing (-l).

The FreeBSD ls clearly attempts to implement this.   The FreeBSD man page
is clearly a fuzzy version of this:

     -c      Use time when file status was last changed for sorting or print-
             ing.
     -u      Use time of last access, instead of last modification of the file
             for sorting (-t) or printing (-l).

The FreeBSD man page is missing the critical detail that the status change
time and access times are used _instead_ of the modification time.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031005195838.U4269>