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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25874 invoked from network); 29 Dec 2021 15:44:50 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 29 Dec 2021 15:44:50 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 9FBD49CFB9; Thu, 30 Dec 2021 01:44:49 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 85C2F9CEF3; Thu, 30 Dec 2021 01:44:36 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="k6HHUina"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 4E57A9CEF3; Thu, 30 Dec 2021 01:44:35 +1000 (AEST) Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) by minnie.tuhs.org (Postfix) with ESMTPS id 835BB9CEA9 for ; Thu, 30 Dec 2021 01:44:34 +1000 (AEST) Received: by mail-oo1-f53.google.com with SMTP id t13-20020a4a760d000000b002dab4d502dfso6799105ooc.6 for ; Wed, 29 Dec 2021 07:44:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to; bh=U6KTgdu01d8gkABNx6LO1vp5dBjVHpQwB53Ah09RGbk=; b=k6HHUinaXtcAocvnFukBOXTd3JNU3QSJozpRw82ElkTdWckD9A1Qe6wPJ0+VCfAChH y4P6ouEtsZ6zOu9tVWcxVGktnBBST+8F5Ppn09R143uCiwvFsXFGxDy5nfh3iyjRgwJV 6Si+vQoh7wRfB8nwYkhTkmsChCt/hR4KovV7PjFlFIgSUEnDKghw3qVRl0LX6hWaF86S kttTTZdngp0VciFjwiGp5W+4PW6OdxpAdsfKZnGZSBGoMVUmB05Ybb+t0oPKBGHi3Ir7 GrmGdFPQI2Q2l61GuIE2UKhs6dxHRymUgHtvQv/tdUDRnMfy92c0mPoq3WwmDSA5Bp7Q ItXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to; bh=U6KTgdu01d8gkABNx6LO1vp5dBjVHpQwB53Ah09RGbk=; b=ybi2UtW38TBJr89fGuc7XjMfIN7YM3s5qUnyHEteZ+lW/wcZvb5GbIdbIr3GYfoFuR K8pTsn7pYKNTtqHG/DmO7VnBqWkua0biIKDUy3/PCeJo2LRTPgrj2x1Bls2Te7moYhTC 1pdsbcNMr/yUSt0iZaSXhfvZwMza5KNX+RbxrZEuXnXqIw327LJixH5AYKScW60W8o4B ZMiudTIFklesyGNEHpzknoAqYvKKjQPEIG82+nqty/I7wIfMTclDTmVExoMb1GWU1g7Z TG3a6tq7uEpifHeqaeqV9EbVWJsiY2Ckj/Hpg0A70cZpJ2QQsZCJlk4zsV6nIMeqFBXJ leFw== X-Gm-Message-State: AOAM532KF+qSOpV/4aWEyYKM3bAfvH3Bohqq6XL8jTo+myvH9Wu03zaN tqcM/7jXfBcbn1OYZnXjegyzy8dKGlEZcA== X-Google-Smtp-Source: ABdhPJwdzdvyISmoxYToYeOdaeUaiv47Zlyv8GMhk/1LvGebtgSmH6RKJSyWZ2cw34Z6lNSu/yaj8g== X-Received: by 2002:a4a:a44b:: with SMTP id w11mr16525851ool.66.1640792673860; Wed, 29 Dec 2021 07:44:33 -0800 (PST) Received: from [192.168.1.13] (035-134-121-000.res.spectrum.com. [35.134.121.0]) by smtp.gmail.com with ESMTPSA id o19sm4706471oiw.22.2021.12.29.07.44.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Dec 2021 07:44:33 -0800 (PST) Content-Type: multipart/alternative; boundary="------------IK3OcI8l10A301ylGG1iipxM" Message-ID: Date: Wed, 29 Dec 2021 09:44:32 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Content-Language: en-US To: Clem Cole References: <529fceae-2493-e9b1-c949-928e95e430e1@gmail.com> From: Will Senn In-Reply-To: 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" This is a multi-part message in MIME format. --------------IK3OcI8l10A301ylGG1iipxM Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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? > > --------------IK3OcI8l10A301ylGG1iipxM Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
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 <will.senn@gmail.com> 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?



--------------IK3OcI8l10A301ylGG1iipxM--