for Marc; -T should display all time information
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 20 Oct 1990 06:34:21 +0000 (22:34 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 20 Oct 1990 06:34:21 +0000 (22:34 -0800)
SCCS-vsn: bin/ls/ls.1 6.15
SCCS-vsn: bin/ls/print.c 5.24

usr/src/bin/ls/ls.1
usr/src/bin/ls/print.c

index 4d3a6a4..48033f0 100644 (file)
@@ -2,7 +2,7 @@
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
 .\" All rights reserved.  The Berkeley software License Agreement
 .\" specifies the terms and conditions for redistribution.
 .\"
-.\"            @(#)ls.1        6.14 (Berkeley) %G%
+.\"            @(#)ls.1        6.15 (Berkeley) %G%
 .\"
 .TH LS 1 "%Q"
 .UC
 .\"
 .TH LS 1 "%Q"
 .UC
@@ -85,6 +85,9 @@ List in long format, giving type and mode (in the format described by
 .IR strmode (3)),
 number of links, owner, size in bytes, and time of last modification
 for each file.
 .IR strmode (3)),
 number of links, owner, size in bytes, and time of last modification
 for each file.
+File times less than six months in the past are displayed as month,
+day, hour and minute, and file times more than six months in the past
+are displayed as month, day and year.
 If the file is a special file the size field will instead contain
 the major and minor device numbers.
 If the file is a symbolic link the pathname of
 If the file is a special file the size field will instead contain
 the major and minor device numbers.
 If the file is a symbolic link the pathname of
@@ -105,13 +108,8 @@ or oldest first as appropriate.
 Display the sizes of files and directories in 512-byte blocks.
 .TP
 .B \-T
 Display the sizes of files and directories in 512-byte blocks.
 .TP
 .B \-T
-By default, file times less than six months in the past are
-displayed as month, day, hour and minute, and file times more
-than six months in the past are displayed as month, day and
-year.
-The \-T option causes
-.I ls
-to display all file times as month, day, hour, and minute.
+Display complete time information for the file, including
+month, day, hour, minute, second, and year.
 .TP
 .B \-t
 Sort by time modified (latest first) instead of
 .TP
 .B \-t
 Sort by time modified (latest first) instead of
index 27bf38a..e64b184 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)print.c    5.23 (Berkeley) %G%";
+static char sccsid[] = "@(#)print.c    5.24 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -158,7 +158,10 @@ printtime(ftime)
                (void)putchar(longstring[i]);
 
 #define        SIXMONTHS       ((DAYSPERNYEAR / 2) * SECSPERDAY)
                (void)putchar(longstring[i]);
 
 #define        SIXMONTHS       ((DAYSPERNYEAR / 2) * SECSPERDAY)
-       if (f_sectime || ftime + SIXMONTHS > time((time_t *)NULL))
+       if (f_sectime)
+               for (i = 11; i < 24; i++)
+                       (void)putchar(longstring[i]);
+       else if (ftime + SIXMONTHS > time((time_t *)NULL))
                for (i = 11; i < 16; ++i)
                        (void)putchar(longstring[i]);
        else {
                for (i = 11; i < 16; ++i)
                        (void)putchar(longstring[i]);
        else {