From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30333 invoked from network); 29 Dec 2021 16:11:09 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 29 Dec 2021 16:11:09 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 936B09CFB9; Thu, 30 Dec 2021 02:11:08 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 32FFA9CEF3; Thu, 30 Dec 2021 02:10:54 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (1024-bit key; unprotected) header.d=ccc.com header.i=@ccc.com header.b="NLU+zt3X"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 36E189CEF3; Thu, 30 Dec 2021 02:10:52 +1000 (AEST) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) by minnie.tuhs.org (Postfix) with ESMTPS id 66EF09CEA9 for ; Thu, 30 Dec 2021 02:10:51 +1000 (AEST) Received: by mail-qk1-f169.google.com with SMTP id de30so20364736qkb.0 for ; Wed, 29 Dec 2021 08:10:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccc.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CFlJBswiunhsfeRNTggmND17+Wnn1gRJwiPE1AltIB0=; b=NLU+zt3XtwvQBqkCkYmsEJENWg9a7SndrjfXXjxAyt5jVWecX9TdMJFeziJfhJaY47 /Wt4HHP7lH5c/HGYXH39z6TsC8PcJCWbCrnLCde/9VZWQZ5BxGQ7VshmfH2ITr/ODpoX K+NTnbbQ13eB00/btvVixUyhBOiSLWYKfqZt8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CFlJBswiunhsfeRNTggmND17+Wnn1gRJwiPE1AltIB0=; b=4B1j+VR+wJO8eKeDOLzCz4x2Hwxlm5R6L9/qDjt+QS8RMSyVqzxZjqnzsGHPJLyLNv 645ORLcmcy/xiKKh92NaGrhWkT1I6o8JUB4BY20p8ngirZfVpTi3NxQU9PWLhzAbvV6q eVH0fn853K5HwvbnPc/aJkwksFuhTFPS4NRwmE7y36Z2Kkpx+tAfrykvOPkca2weY9TO IhNyeX2Qvj2frgvIOAq0nHI8Kvo3xPFiJOkb4WkIDLovULhtAUJVIRcse3wd5QF5vGcE JK9n9pEA60ZmloGCs33YsOAuF5uNRZTUGfgt60ntp4niLXoKYw9msjpEtcxVnK7BcJ0A /Czg== X-Gm-Message-State: AOAM5328emGKA4WtAWXS/gnBv7ZS7Px/vo/f0c2Y/nfckwG8Kgp84UOA 97qHtGt4ARYLQSKG6WFSc7tNUBahLbmWPtQ8eApkIWcxdmTZJjaO X-Google-Smtp-Source: ABdhPJyHHIWK4XRUZKBmy03PsI8sKefT+G1rGC2K+Xw9tHi5yyRQEGYmdLxsHMnkQ3M5sKSM80Fq6XhXIuUayif/3xc= X-Received: by 2002:a37:b3c7:: with SMTP id c190mr19037571qkf.730.1640794250286; Wed, 29 Dec 2021 08:10:50 -0800 (PST) MIME-Version: 1.0 References: <529fceae-2493-e9b1-c949-928e95e430e1@gmail.com> In-Reply-To: From: Clem Cole Date: Wed, 29 Dec 2021 11:10:24 -0500 Message-ID: To: Will Senn Content-Type: multipart/alternative; boundary="00000000000070314305d44b2e4e" Subject: Re: [TUHS] moving directories in svr2 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: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --00000000000070314305d44b2e4e Content-Type: text/plain; charset="UTF-8" Just get the 4.1 man pages and it says: "Directories may only be moved within the same parent directory." On Wed, Dec 29, 2021 at 10:44 AM Will Senn wrote: > On 12/29/21 9:17 AM, Clem Cole wrote: > > Not until the BSD rename system call,. > > Try it on V6 or V7 and you will get 'directory exists' as an error. > > Sure enough. I never really noticed. I guess cuz I was careful about > creating directories in the first place. > > Think about the UNIX FS and the link system call. How is mv implemented? > You link the file to the new directory and the unlink it from the old one. > But a directory file can not be in two directories at the same time as > the .. link would fail. When Joy created the rename system call it > became possible. Until System V picked it up (IIRC was SVR3), only system > that supported the BSD world. > > Nice summary. I will add it to my systems programming investigations list. > > What I have forgotten is if the BSD mv command for 4.1 supported it. If > it did then it was not atomic -- it would have had to create the new > directory, move the contents independently and then remove the old one. > > FWIW: when we did the first SMP UNIX at Masscomp we had supported the BSD > FS and the 4.1c/4.2 system calls. Joy's implementation of rename was a > real mess. Making it atomic, supporting an SMP and deal with all the > recovery paths on an error took some work. It's funny, the rename system > call is a simple idea, but on a failure when partially thru it, makes > unwinding the partial completion an interesting problem. > > It's impressive what early work was done and how few today really > understand the challenges that were met and overcome to give us our cushy > oses. > > > Clem > > On Wed, Dec 29, 2021 at 9:34 AM Will Senn wrote: > >> I'm a little flummoxed in trying to move some directories around in svr2. >> Shouldn't the following work? >> >> mkdir a >> mkdir b >> mv a b >> >> I get the following error: >> mv: b exists >> >> I tried many of the possible variants including: >> >> mv a b/ >> mv: b/ exists >> mv a b/a >> mv: directory rename only >> cd b >> mv ../a . >> mv: . exists >> mv ../a ./ >> mv: ./ exists >> mv ../a ./a >> mv: directory rename only >> >> >> If moving directories into existing directories wasn't allowed in those >> days, 1) how were directories managed? and 2) when did moving directories >> into directories become a thing? >> >> >> > --00000000000070314305d44b2e4e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Just get the 4.1 man pages and it says: "Directori= es may only be moved within the same parent directory."
On Wed, D= ec 29, 2021 at 10:44 AM Will Senn <will.senn@gmail.com> wrote:
=20 =20 =20
On 12/29/21 9:17 AM, Clem Cole wrote:
=20
Not until the BSD rename system call,.

Try it on V6 or V7 and you will get 'directory exists' as an error.

Sure enough. I never really noticed. I guess cuz I was careful about creating directories in the first place.

Think about the UNIX FS and the link system call. How is mv implemented? =C2=A0 Y= ou link the file to the new directory and the unlink it from=C2=A0th= e old one. =C2=A0 But a directory file can not be in two directorie= s at the same time as the .. link would fail. =C2=A0 =C2=A0 =C2=A0W= hen Joy created the rename system call it became possible.=C2=A0 Until System V picked it up (IIRC was SVR3), only system that supported the BSD world.

Nice summary. I will add it to my systems programming investigations list.
What I have forgotten is if the BSD mv command for 4.1 supported it.=C2=A0 If it did then it was not atomic -- it would have had to create the new directory, move the contents independently=C2=A0and then remove the old one.

FWIW: when we did the first SMP UNIX at Masscomp we had supported the BSD FS and the 4.1c/4.2 system calls. =C2=A0 Joy's implementation of rename was a real mess. =C2=A0 Making it atomic, supporting an SM= P and deal with all the recovery paths on an error took some work.=C2=A0 It's funny, the rename system call is a simple id= ea, but on a failure when partially=C2=A0thru it, makes unwinding the partial completion an interesting problem.
It's impressive what early work was done and how few today really understand the challenges that were met and overcome to give us our cushy oses.

Clem

On Wed, Dec 29, 2021 at 9:34 AM Will Senn <will.senn@gmail.com> wrote:
I'm a littl= e flummoxed in trying to move some directories around in svr2. Shouldn't the following work?

=C2=A0=C2=A0=C2=A0 mkdir a
=C2=A0=C2=A0=C2=A0 mkdir b
=C2=A0=C2=A0=C2=A0 mv a b

I get the following error:
=C2=A0=C2=A0=C2=A0 mv: b exists

I tried many of the possible variants including:
mv a b/
mv: b/ exists
mv a b/a
mv: directory rename only
cd b
mv ../a .
mv: . exists
mv ../a ./
mv: ./ exists
mv ../a ./a
mv: directory rename only

If moving directories into existing directories wasn't allowed in those days, 1) how were directories managed? and 2) when did moving directories into directories become a thing?



--00000000000070314305d44b2e4e--