Sync with CSRG.

This commit is contained in:
mycroft 1994-12-27 23:14:46 +00:00
parent 168de79d49
commit d966913f57
5 changed files with 40 additions and 15 deletions

View File

@ -32,10 +32,10 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" from: @(#)ls.1 8.6 (Berkeley) 4/18/94
.\" $Id: ls.1,v 1.9 1994/09/23 06:14:48 mycroft Exp $
.\" from: @(#)ls.1 8.7 (Berkeley) 7/29/94
.\" $Id: ls.1,v 1.10 1994/12/27 23:14:46 mycroft Exp $
.\"
.Dd April 18, 1994
.Dd July 29, 1994
.Dt LS 1
.Os
.Sh NAME
@ -43,7 +43,7 @@
.Nd list directory contents
.Sh SYNOPSIS
.Nm ls
.Op Fl ACFLRSTacdfikloqrstu1
.Op Fl ACFLRSTWacdfikloqrstu1
.Op Ar file ...
.Sh DESCRIPTION
For each operand that names a
@ -82,7 +82,8 @@ Force multi-column output; this is the default when output is to a terminal.
Display a slash (/) immediately after each pathname
that is a directory, an asterisk (*) after each that is
executable,
and an at sign (@) after each symbolic link.
an at sign (@) after each symbolic link,
and a percent sign (%) after each whiteout.
.\" and a vertical bar (|) after each that is a
.\" .Tn FIFO .
.It Fl L
@ -95,6 +96,8 @@ Sort by size, largest file first.
.It Fl T
Display complete time information for the file, including
month, day, hour, minute, second, and year.
.It Fl W
Display whiteouts when scanning directories.
.It Fl a
Include directory entries whose names begin with a
dot (.).
@ -220,6 +223,8 @@ Symbolic link.
Socket link.
.\" .It Sy p
.\" .Tn FIFO .
.It Sy w
Whiteout.
.It Sy \-
Regular file.
.El

View File

@ -41,8 +41,8 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
/*static char sccsid[] = "from: @(#)ls.c 8.5 (Berkeley) 4/2/94";*/
static char *rcsid = "$Id: ls.c,v 1.12 1994/09/23 06:14:51 mycroft Exp $";
/*static char sccsid[] = "from: @(#)ls.c 8.7 (Berkeley) 8/5/94";*/
static char *rcsid = "$Id: ls.c,v 1.13 1994/12/27 23:14:49 mycroft Exp $";
#endif /* not lint */
#include <sys/types.h>
@ -98,6 +98,7 @@ int f_size; /* list size in short listing */
int f_statustime; /* use time of last mode change */
int f_dirname; /* if precede with directory name */
int f_type; /* add type character for non-regular files */
int f_whiteout; /* show whiteout entries */
int
main(argc, argv)
@ -128,7 +129,7 @@ main(argc, argv)
f_listdot = 1;
fts_options = FTS_PHYSICAL;
while ((ch = getopt(argc, argv, "1ACFLRSTacdfgikloqrstu")) != -1) {
while ((ch = getopt(argc, argv, "1ACFLRSTWacdfgikloqrstu")) != -1) {
switch (ch) {
/*
* The -1, -C and -l options all override each other so shell
@ -209,6 +210,9 @@ main(argc, argv)
case 't':
sortkey = BY_TIME;
break;
case 'W':
f_whiteout = 1;
break;
default:
case '?':
usage();
@ -232,6 +236,14 @@ main(argc, argv)
if (!f_longform && !f_listdir && !f_type)
fts_options |= FTS_COMFOLLOW;
/*
* If -W, show whiteout entries.
*/
#ifdef FTS_WHITEOUT
if (f_whiteout)
fts_options |= FTS_WHITEOUT;
#endif
/* If -l or -s, figure out block size. */
if (f_longform || f_size) {
if (!kflag)

View File

@ -35,8 +35,8 @@
*/
#ifndef lint
/*static char sccsid[] = "from: @(#)print.c 8.4 (Berkeley) 4/17/94";*/
static char *rcsid = "$Id: print.c,v 1.11 1994/09/23 06:14:55 mycroft Exp $";
/*static char sccsid[] = "from: @(#)print.c 8.5 (Berkeley) 7/27/94";*/
static char *rcsid = "$Id: print.c,v 1.12 1994/12/27 23:14:50 mycroft Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -265,6 +265,9 @@ printtype(mode)
case S_IFSOCK:
(void)putchar('=');
return (1);
case S_IFWHT:
(void)putchar('%');
return (1);
}
if (mode & (S_IXUSR | S_IXGRP | S_IXOTH)) {
(void)putchar('*');

View File

@ -32,8 +32,8 @@
*/
#ifndef lint
/*static char sccsid[] = "from: @(#)stat_flags.c 8.1 (Berkeley) 5/31/93";*/
static char *rcsid = "$Id: stat_flags.c,v 1.2 1994/09/23 06:14:57 mycroft Exp $";
/*static char sccsid[] = "from: @(#)stat_flags.c 8.2 (Berkeley) 7/27/94";*/
static char *rcsid = "$Id: stat_flags.c,v 1.3 1994/12/27 23:14:52 mycroft Exp $";
#endif /* not lint */
#include <sys/types.h>
@ -70,6 +70,8 @@ flags_to_string(flags, def)
SAPPEND("uchg");
if (flags & UF_NODUMP)
SAPPEND("nodump");
if (flags & UF_OPAQUE)
SAPPEND("opaque");
if (flags & SF_APPEND)
SAPPEND("sappnd");
if (flags & SF_ARCHIVED)
@ -127,6 +129,9 @@ string_to_flags(stringp, setp, clrp)
clear = !clear;
TEST(p, "dump", UF_NODUMP);
return (1);
case 'o':
TEST(p, "opaque", UF_OPAQUE);
return (1);
case 's':
TEST(p, "sappnd", SF_APPEND);
TEST(p, "sappend", SF_APPEND);

View File

@ -35,8 +35,8 @@
*/
#ifndef lint
/*static char sccsid[] = "from: @(#)util.c 8.3 (Berkeley) 4/2/94";*/
static char *rcsid = "$Id: util.c,v 1.9 1994/10/25 02:29:46 mycroft Exp $";
/*static char sccsid[] = "from: @(#)util.c 8.4 (Berkeley) 7/27/94";*/
static char *rcsid = "$Id: util.c,v 1.10 1994/12/27 23:14:54 mycroft Exp $";
#endif /* not lint */
#include <sys/types.h>
@ -68,6 +68,6 @@ void
usage()
{
(void)fprintf(stderr, "usage: ls [-1ACFLRSTacdfikloqrstu] [file ...]\n");
(void)fprintf(stderr, "usage: ls [-1ACFLRSTWacdfikloqrstu] [file ...]\n");
exit(1);
}