The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: kstailey@yahoo.com (Kenneth Stailey)
Subject: [TUHS] (no subject)
Date: Fri, 23 May 2003 20:42:24 -0700 (PDT)	[thread overview]
Message-ID: <20030524034224.21529.qmail@web10008.mail.yahoo.com> (raw)
In-Reply-To: <e0190f1c49950f6047d23047f9a45a1f@plan9.bell-labs.com>

--- Dennis Ritchie <dmr at plan9.bell-labs.com> wrote:
>  > The V7 ls(1) man page says that the -s option, which prints total
>  >blocks, includes any indirect blocks.
> 
>  >However, the V7 struct stat didn't have the st_blocks member in the
>  > struct stat, and the code in ls.c uses
> 
>  > 	long
>  >	nblock(size)
>  >	long size;
>  >	{
>  >		return((size+511)>>9);
>  >	}
> 
>  >So, is this just a case of the man page being mistaken?
> 
> Yes, it looks like a manual bug. Retrieving
> the true number of indirect blocks isn't possible
> from the 7th edition stat.  I'm not sure when (or by
> whom) the st_blocks member was added.
> 
>  > While I'm at it, the V7 ls -a option only adds . and .. to the
>  > list; apparently all other dot files were printed by default.
>  > When did ls change such that -a applied to all dot files?
> 
> UCB or USL did this (I'm sure which first).
> Both tended to use more . files.
> 
> 	Dennis
> _______________________________________________
> TUHS mailing list
> TUHS at minnie.tuhs.org
> http://minnie.tuhs.org/mailman/listinfo/tuhs

1BSD ls.c has:

        for(;;) {
                p = &dentry;
                for (j=0; j<16; j++)
                        *p++ = getc(&inf);
                if (dentry.dinode==0
                 || aflg==0 && dentry.dname[0]=='.')
                        continue;
                if (dentry.dinode == -1)
                        break;
                ep = gstat(makename(dir, dentry.dname), 0);
                if (ep->lnum != -1)
                        ep->lnum = dentry.dinode;
                for (j=0; j<14; j++)
                        ep->lname[j] = dentry.dname[j];
        }

so it skips all that start with "." unless aflg is set from invoking ls with
-a.

I got it from the 1BSD tape that is on the CSRG archive CD-ROM set.  I had to
port ar11 to FreeBSD/i386 to get the sources out of the cont.a files.  If
anyone wants my port of ar11 I can send it to them.

ls.c starts with this block of comments:

#
/*
 * ls - list file or directory
 *
 * Modified by Bill Joy UCB May/August 1977
 *
 * This version of ls is designed for graphic terminals and to
 * list directories with lots of files in them compactly.
 * It supports three variants for listings:
 *
 *      1) Columnar output.
 *      2) Stream output.
 *      3) Old one per line format.
 *
 * Columnar output is the default.
 * If, however, the standard output is not a teletype, the default
 * is one-per-line.
 *
 * With columnar output, the items are sorted down the columns.
 * We use columns only for a directory we are interpreting.
 * Thus, in particular, we do not use columns for
 *
 *      ls /usr/bin/p*
 *
 * This version of ls also prints non-printing characters as '?' if
 * the standard output is a teletype.
 *
 * Flags relating to these and other new features are:
 *
 *      -m      force stream output.
 *
 *      -1      force one entry per line, e.g. to a teletype
 *
 *      -q      force non-printings to be '?'s, e.g. to a file
 *
 *      -c      force columnar output, e.g. into a file
 *
 *      -n      like -l, but user/group id's in decimal rather than
 *              looking in /etc/passwd to save time
 */

It's interesting they called CRTs "graphic terminals".


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com



  reply	other threads:[~2003-05-24  3:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-23  4:10 Dennis Ritchie
2003-05-24  3:42 ` Kenneth Stailey [this message]
2005-07-20 21:17 Brantley Coile
2006-02-22  5:08 dmr
2010-01-13  3:42 Larry McVoy
2015-07-18 17:43 Mark Longridge
2015-07-18 17:53 ` Larry McVoy
2015-07-19  0:57   ` Warren Toomey
2015-07-19  1:13     ` Larry McVoy
2015-07-19  1:19       ` Milo Velimirovic
2015-07-19 20:55 Brian Walden
2015-12-24 18:09 scj
2015-12-24 18:09 scj
2015-12-26  4:49 Doug McIlroy
2015-12-26  4:51 Doug McIlroy
2021-04-05 22:43 M Douglas McIlroy
2021-04-06  7:23 ` arnold
2021-04-06 23:25 ` Dave Horsfall
2021-04-07  1:01   ` Jon Steinhart
2022-01-11 23:02 Douglas McIlroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030524034224.21529.qmail@web10008.mail.yahoo.com \
    --to=kstailey@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).