The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Warner Losh <imp@bsdimp.com>
To: Anthony Martin <ality@pbrane.org>
Cc: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: Re: [TUHS] A question about ls(1)
Date: Sat, 27 Apr 2019 09:38:27 -0600	[thread overview]
Message-ID: <CANCZdfoftxQ47J7yu--Pqdgiatxz22axn=3Pq=8G30UQBAfpig@mail.gmail.com> (raw)
In-Reply-To: <20190427141655.GA8310@alice>

[-- Attachment #1: Type: text/plain, Size: 1698 bytes --]

On Sat, Apr 27, 2019 at 8:26 AM Anthony Martin <ality@pbrane.org> wrote:

> From at least V2 to V6, the ls(1) command would not
> show directory entries whose names began with a '.'
> unless the -a flag was supplied.
>
> This was changed in V7: only the directory entries
> for "." and ".." would be skipped by default.
>

gnu ls does not follow this convention. The system V sources one can find
on the internet have the curious code:

#define DOTSUP  1
...
                        if (aflg==0 && dentry->d_name[0]=='.'
# ifndef DOTSUP
                                && (dentry->d_name[1]=='\0' ||
dentry->d_name[1]=='.'
                                && dentry->d_name[2]=='\0')
# endif
                                )  /* check for directory items '.', '..',
                                   *  and items without valid inode-number;
                                   */
                                continue;

which is the V7 behavior ifdef'd out.


> All further versions of Research Unix retain the
> convention of V7 and Plan 9 ultimately made it
> unnecessary. However, BSD and its descendants did
> not follow suit. Instead, they continued behaving
> like V6 with an additional -A flag to emulate V7.
>

This has been the BSD convention since at least 4BSD :)

But I find this interesting, since the 8th edition was based on BSD 4.1c I
thought....

And system III and later all have the above code.


> Was the initial behavior intentional or just a
> matter of expediency?
>
> Who made the change and what was their motivation?
> Was it a reaction to the intentional hiding of what
> came to be known as "dot files"?


It looks like, from the source, to be a blip in V7.

Warner

[-- Attachment #2: Type: text/html, Size: 2971 bytes --]

  reply	other threads:[~2019-04-27 15:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-27 14:16 Anthony Martin
2019-04-27 15:38 ` Warner Losh [this message]
2019-04-27 15:42   ` Larry McVoy
2019-04-28 23:59   ` Warner Losh
2019-04-28 11:47 ` Dan Cross
2019-04-28 12:00   ` arnold
2019-04-28 14:44   ` jcs
2019-04-28 16:15   ` Bakul Shah
2019-04-27 20:11 Norman Wilson
2019-04-27 23:03 Noel Chiappa
2019-04-28 16:54 Norman Wilson
2019-04-28 19:45 ` Jon Forrest
2019-04-28 20:00   ` Bakul Shah
2019-04-29 18:05     ` Michael Kjörling
2019-04-29 20:37       ` Warner Losh
2019-04-29 20:44       ` Christopher Browne
2019-04-30  6:44         ` Michael Kjörling
2019-04-30  7:24           ` Kurt H Maier
2019-04-30 10:35             ` Wesley Parish
2019-04-29 22:32       ` Bakul Shah
2019-04-30 11:52         ` Theodore Ts'o
2019-04-28 22:16   ` Thoma Paulsen
2019-04-29  0:53     ` John P. Linderman

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='CANCZdfoftxQ47J7yu--Pqdgiatxz22axn=3Pq=8G30UQBAfpig@mail.gmail.com' \
    --to=imp@bsdimp.com \
    --cc=ality@pbrane.org \
    --cc=tuhs@tuhs.org \
    /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).