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: Sun, 28 Apr 2019 17:59:09 -0600	[thread overview]
Message-ID: <CANCZdfq43-MaVcNDjjQgEUGdv1Vr8=iBzZMRzRQhLE5x98=wtg@mail.gmail.com> (raw)
In-Reply-To: <CANCZdfoftxQ47J7yu--Pqdgiatxz22axn=3Pq=8G30UQBAfpig@mail.gmail.com>

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

On Sat, Apr 27, 2019 at 9:38 AM Warner Losh <imp@bsdimp.com> wrote:

>
>
> 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.
>

I've confirmed that all the ls.c's that I have from AT&T, apart from
research, do the . is a hidden file thing in ls. All the research things
inherit the V7 behavior (though the V8 sources I found have an
off-by-default ifdef for the BSD behavior). All descendants of SysV that I
could find source to have the V6 behavior, not V7. Both system III and all
revs of System V I could find have an #ifdef for this, and a 1 line change
restore the V7 behavior. Illumos has the BSD semantics and has lost even
the ifdef.

As pointed out later in the thread I was incorrect about 'base on 4.1BSD. I
took a closer look at the sources we have. The kernel has various bits of
BSD included in it starting in V8, but as noted the networking bits seem
odd to my eye. I didn't do a detailed analysis beyond spot checking a few
files. The userland looks more like evolved V7 code with some BSDism
imported rather than a wholesale switch to the BSD versions.

I like the dot is hidden thing. It's simple, elegant, and transports to
other systems well, so long as they are unix or have filesystems that don't
get hung up on 'extension'. That latter bit is likely why many find it...
distasteful.

Warner

>

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

  parent reply	other threads:[~2019-04-28 23:59 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
2019-04-27 15:42   ` Larry McVoy
2019-04-28 23:59   ` Warner Losh [this message]
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='CANCZdfq43-MaVcNDjjQgEUGdv1Vr8=iBzZMRzRQhLE5x98=wtg@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).