From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 7e51f8e9 for ; Sat, 27 Apr 2019 15:39:15 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id D198393D51; Sun, 28 Apr 2019 01:39:13 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id E015493D2A; Sun, 28 Apr 2019 01:38:42 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=bsdimp-com.20150623.gappssmtp.com header.i=@bsdimp-com.20150623.gappssmtp.com header.b="Oe6FGeSc"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id DA22C93D2A; Sun, 28 Apr 2019 01:38:40 +1000 (AEST) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by minnie.tuhs.org (Postfix) with ESMTPS id F249093D27 for ; Sun, 28 Apr 2019 01:38:39 +1000 (AEST) Received: by mail-qt1-f178.google.com with SMTP id b3so7449876qtc.12 for ; Sat, 27 Apr 2019 08:38:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fGxMJrK9pSGlUdoI7Z9Tj171Pziu2iAgG38XREuz5f4=; b=Oe6FGeSccplf4GPkAgGZyuMT9bFlLMNYtwdzGgUh6TrdMG87SbukdS1DbCy4sYJixQ chINrSciLdaB46enBWrB3lX/zf42ozq9uMlEBRRHm3afPd70HYdKE49bQu362KnXXq7P kvQZ0qV02hRay1HFsSuT72APKvT1OHFzQEdll/iblcLb3mwVlrl8J4/Ql9k8jkckHjY5 VuIBPFmhPaGgg/FpKlPrhh8vYMtVcn3mHeL74XOHcTngai2KT7Ly9zRg4p+JSxORFsoJ Jry8MebjithT84XmeOsOUjCFEAQq0F1fuYuE8YIs0TpFmllGGHRrMZlKUZaVjXO3/874 1mqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fGxMJrK9pSGlUdoI7Z9Tj171Pziu2iAgG38XREuz5f4=; b=KvXu3WsWxc2smnAQ8tCyRjEM0km4iDjBew9zBq7XMRqcuUpU//ykPL6NNZSYR8QUtF lZkgokHW9Gq5YQu31ssDOvpwsogbz8jsssHx4UAI5QwvOaBfT2Ex/Qo7rJ9LxcacNa00 fIjRvOjl9Yx0DcJnPAl0i7ejkt3lFxH0Lelm5Eqfc2Pdp29oORS94/1uM/b8XOMb0qsL lITRHBW+rpdiQkF6G7Tk+6Vd/9UyysvfVaeadAQUZ4/mJLUmXVDCB28RzkYlz4d58TbN PoiNCBtYysaF4yeKCJaFKDeN7n6G9AHeRoxy9a6LDlyll2ZEBHyq9m7bL7bwLzA3yLYL OgEA== X-Gm-Message-State: APjAAAVlRtw2y5A1ZzTLDBKaIfCWDfAGZ/gTulSuVA2DPt4oYXdUCCir AhZZX45NwTVHL0u7bxKozviYKFJtLdPyvXw9xeOV6idd5Mc= X-Google-Smtp-Source: APXvYqw4zgaLvQaTxdZxzcQ0i8kimQIkk8OjuKUiZIC0kdRh/bxECE7YzoTplO6yCYWqyUdW7If0ThiRl6ilJA0yhCU= X-Received: by 2002:a0c:980b:: with SMTP id c11mr65034qvd.115.1556379518848; Sat, 27 Apr 2019 08:38:38 -0700 (PDT) MIME-Version: 1.0 References: <20190427141655.GA8310@alice> In-Reply-To: <20190427141655.GA8310@alice> From: Warner Losh Date: Sat, 27 Apr 2019 09:38:27 -0600 Message-ID: To: Anthony Martin Content-Type: multipart/alternative; boundary="0000000000005b6400058784d8aa" Subject: Re: [TUHS] A question about ls(1) X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: The Eunuchs Hysterical Society Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --0000000000005b6400058784d8aa Content-Type: text/plain; charset="UTF-8" On Sat, Apr 27, 2019 at 8:26 AM Anthony Martin 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 --0000000000005b6400058784d8aa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, Apr 27, 2019 at 8:26 AM Anthony Mart= in <ality@pbrane.org> wrote:<= br>
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 syst= em V sources one can find on the internet have the curious code:
=

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

which is the V7 beha= vior ifdef'd out.
=C2=A0
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 bas= ed on BSD 4.1c I thought....

And system III and la= ter all have the above code.
=C2=A0
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=C2=A0
--0000000000005b6400058784d8aa--