GNU bug report logs - #36831
enhance 'directory not empty' message

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Reported by: Alex Mantel <alexmantel93@HIDDEN>; dated Sun, 28 Jul 2019 20:29:01 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.

Message received at 36831 <at> debbugs.gnu.org:


Received: (at 36831) by debbugs.gnu.org; 3 Aug 2019 05:39:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 03 01:39:52 2019
Received: from localhost ([127.0.0.1]:58175 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1htmlk-000215-Cw
	for submit <at> debbugs.gnu.org; Sat, 03 Aug 2019 01:39:52 -0400
Received: from mail-pg1-f193.google.com ([209.85.215.193]:46078)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <assafgordon@HIDDEN>) id 1htmli-00020m-6D
 for 36831 <at> debbugs.gnu.org; Sat, 03 Aug 2019 01:39:50 -0400
Received: by mail-pg1-f193.google.com with SMTP id o13so37056198pgp.12
 for <36831 <at> debbugs.gnu.org>; Fri, 02 Aug 2019 22:39:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=0hI4ewQvSf9LGrZ9V0dGcL5+6R0CjDFdU1Yskxwey+M=;
 b=oaC7oPpQjlXlf5LewW2Fk/RzHruZYTi0d+hNhfG2QCsLsJ47WCFsL+Sro3JdZEwZmZ
 bK7+sgFYU5zT1CbWowLUUjtWQolNAmhyAmwJhTNlh/O1vwnMlBoydLeXv5T8R68DSF4Q
 z3ccwE/FhqIli+kn1u/nNv/LRsbqXg0lP3FdXTt5+fzoHmTiXGQqt1MMNppaM6Lh4Bn8
 oeeYm/YU1fhp8daPgZVWmKm8KW3/L7gI0rpd1ueu6Icmpcx8OoV2zdnkk2+ctQzx/pnh
 xOuWIUXjN5vxmnv+i9el+SIy773M3MwhYsR0Yp0L9u2B/KePyUgyy7NNPYT9v6OMJg8K
 XchQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:subject:to:cc:references:from:message-id:date
 :user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=0hI4ewQvSf9LGrZ9V0dGcL5+6R0CjDFdU1Yskxwey+M=;
 b=YApWm3IJyo4htlU6YlyLTA6PA/jUflT6s3GHsA8xYXcN4l1T7yeH4yVUUL80+J/FOs
 E/Ft9h46UrdGxuPmEb0Ptu4AjNgetBuWwzkP4KQzFnMjgP9EEPPocAZeSILa8SZoZ6vW
 I4vpG9lIfpgYvR5F5X+DOshvT2r0O3PIvJODO6EGq3XNeNL31kfuIb3JDc/ZKpxifCWs
 JeU4sjTGwwA7xQQxZyxKK1kJRanAJ3+LCVhiVJfcAReT6v24Ru7hrMzNu8m2vJTW8x8U
 808W3snA4BsqRc1NgRMSOgicXENXpNCZgEGNTDo1L87JsnJNBTB1ZiGuGt+sDbyL4y5u
 Ppvw==
X-Gm-Message-State: APjAAAUzM3+pDuvue1Cj7JCWSJoE1rEE/NsWVDI0AVIXPAigHkqlyWWd
 Va5zQ38X7RJe3eXf8kQ0k3FEO1KR
X-Google-Smtp-Source: APXvYqxsBbM8GFwftw7l6KWih6K900XJtqPNFp6mPIN4+DYZIGH/H3NpBes17RHRAz1Mi3C9WYQZ3w==
X-Received: by 2002:a63:e5a:: with SMTP id 26mr122787189pgo.3.1564810783681;
 Fri, 02 Aug 2019 22:39:43 -0700 (PDT)
Received: from tomato.moose.housegordon.com (moose.housegordon.com.
 [184.68.105.38])
 by smtp.googlemail.com with ESMTPSA id u6sm9349431pjx.23.2019.08.02.22.39.42
 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128);
 Fri, 02 Aug 2019 22:39:42 -0700 (PDT)
Subject: Re: bug#36831: Enhance directory move. (was Re: bug#36831: enhance
 'directory not empty' message)
To: L A Walsh <coreutils@HIDDEN>
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
 <5D44054B.3080907@HIDDEN>
 <20190803024708.GI15401@HIDDEN>
 <5D4505DF.5040006@HIDDEN>
From: Assaf Gordon <assafgordon@HIDDEN>
Message-ID: <5880eb87-7f00-9703-e6e2-204dbcda12fb@HIDDEN>
Date: Fri, 2 Aug 2019 23:39:41 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.8.0
MIME-Version: 1.0
In-Reply-To: <5D4505DF.5040006@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36831
Cc: alexmantel93@HIDDEN, 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello,

On 2019-08-02 9:56 p.m., L A Walsh wrote:
> On 2019/08/02 19:47, Assaf Gordon wrote:
>> Can new merging features be added to 'mv'? yes.
>> But it seems to me these would be better suited for 'higher level'
>> programs (e.g. a GUI file manager).
> ---
> 	But neither the person who posted the original bug on this
> nor I are using a GUI, we are running 'mv' GUI, we use the cmd line on linux, so that wouldn't
> be of any use.

The original post was about the error *message*, asking to make it 
clearer. That is the topic of this thread (and the previous patch) -
so let's leave them at that.


I see you started a new thread ( https://bugs.gnu.org/36901 ),
so I'll reply there.





Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at 36831 <at> debbugs.gnu.org:


Received: (at 36831) by debbugs.gnu.org; 3 Aug 2019 03:56:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 02 23:56:21 2019
Received: from localhost ([127.0.0.1]:58139 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1htl9Z-0006h9-0c
	for submit <at> debbugs.gnu.org; Fri, 02 Aug 2019 23:56:21 -0400
Received: from ishtar.tlinx.org ([173.164.175.65]:60114
 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <coreutils@HIDDEN>) id 1htl9X-0006gz-Ak
 for 36831 <at> debbugs.gnu.org; Fri, 02 Aug 2019 23:56:19 -0400
Received: from [192.168.3.12] (Athenae [192.168.3.12])
 by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id
 x733uFLC035556; Fri, 2 Aug 2019 20:56:17 -0700
Message-ID: <5D4505DF.5040006@HIDDEN>
Date: Fri, 02 Aug 2019 20:56:15 -0700
From: L A Walsh <coreutils@HIDDEN>
User-Agent: Thunderbird
MIME-Version: 1.0
To: Assaf Gordon <assafgordon@HIDDEN>
Subject: Re: Enhance directory move.  (was Re: bug#36831: enhance 'directory
 not empty' message)
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
 <5D44054B.3080907@HIDDEN>
 <20190803024708.GI15401@HIDDEN>
In-Reply-To: <20190803024708.GI15401@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36831
Cc: Alex Mantel <alexmantel93@HIDDEN>, Coreutils <bug-coreutils@HIDDEN>,
 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



On 2019/08/02 19:47, Assaf Gordon wrote:
> Can new merging features be added to 'mv'? yes.
> But it seems to me these would be better suited for 'higher level'
> programs (e.g. a GUI file manager).
---
	But neither the person who posted the original bug on this
nor I are using a GUI, we are running 'mv' GUI, we use the cmd line on li=
nux, so that wouldn't
be of any use.

If the command was named 'ren', then I'd expect it to be dummer,
but 'mv'/move seem like it should be able to move files from
one dir into another.

But you say posix wants it to perform as a rename?
I know, create a 're' command (or 'rn') for rename, and have
it do what 'mv' would do.  Maybe posix would realize it would
be better to have re/rn behave like rename, and 'mv' to
behave it was moving something.

So if I have:
mkdir A B
touch A/foo B/fee

So when I look at the system call on linux for rename:
       oldpath can specify a directory.  In this case, newpath must eithe=
r not
       exist, or it must specify an empty directory.
        (complying with POSIX_C_SOURCE >=3D 200809L)

So move should give an error: Nope:

mv A B
> tree B
B
=E2=94=9C=E2=94=80=E2=94=80 A
=E2=94=82   =E2=94=94=E2=94=80=E2=94=80 foo
=E2=94=94=E2=94=80=E2=94=80 fee

1 directory, 2 files

So mv is violating POSIX - it didn't do the rename, but moved
A under B and neither dir had to be empty.

Saying it has to follow POSIX when it doesn't appear to, seems
a bit contradictory?













Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Aug 2019 03:56:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 02 23:56:35 2019
Received: from localhost ([127.0.0.1]:58142 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1htl9n-0006hj-9S
	for submit <at> debbugs.gnu.org; Fri, 02 Aug 2019 23:56:35 -0400
Received: from lists.gnu.org ([209.51.188.17]:58317)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <coreutils@HIDDEN>) id 1htl9m-0006hc-0V
 for submit <at> debbugs.gnu.org; Fri, 02 Aug 2019 23:56:34 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:57284)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <coreutils@HIDDEN>) id 1htl9j-0000vR-VB
 for bug-coreutils@HIDDEN; Fri, 02 Aug 2019 23:56:33 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <coreutils@HIDDEN>) id 1htl9j-0000W1-3T
 for bug-coreutils@HIDDEN; Fri, 02 Aug 2019 23:56:31 -0400
Received: from ishtar.tlinx.org ([173.164.175.65]:40028
 helo=Ishtar.sc.tlinx.org)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <coreutils@HIDDEN>) id 1htl9i-0000UB-1r
 for bug-coreutils@HIDDEN; Fri, 02 Aug 2019 23:56:31 -0400
Received: from [192.168.3.12] (Athenae [192.168.3.12])
 by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id
 x733uFLC035556; Fri, 2 Aug 2019 20:56:17 -0700
Message-ID: <5D4505DF.5040006@HIDDEN>
Date: Fri, 02 Aug 2019 20:56:15 -0700
From: L A Walsh <coreutils@HIDDEN>
User-Agent: Thunderbird
MIME-Version: 1.0
To: Assaf Gordon <assafgordon@HIDDEN>
Subject: Re: Enhance directory move.  (was Re: bug#36831: enhance 'directory
 not empty' message)
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
 <5D44054B.3080907@HIDDEN>
 <20190803024708.GI15401@HIDDEN>
In-Reply-To: <20190803024708.GI15401@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
 timestamps) [generic]
X-Received-From: 173.164.175.65
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
Cc: Alex Mantel <alexmantel93@HIDDEN>, Coreutils <bug-coreutils@HIDDEN>,
 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)



On 2019/08/02 19:47, Assaf Gordon wrote:
> Can new merging features be added to 'mv'? yes.
> But it seems to me these would be better suited for 'higher level'
> programs (e.g. a GUI file manager).
---
	But neither the person who posted the original bug on this
nor I are using a GUI, we are running 'mv' GUI, we use the cmd line on li=
nux, so that wouldn't
be of any use.

If the command was named 'ren', then I'd expect it to be dummer,
but 'mv'/move seem like it should be able to move files from
one dir into another.

But you say posix wants it to perform as a rename?
I know, create a 're' command (or 'rn') for rename, and have
it do what 'mv' would do.  Maybe posix would realize it would
be better to have re/rn behave like rename, and 'mv' to
behave it was moving something.

So if I have:
mkdir A B
touch A/foo B/fee

So when I look at the system call on linux for rename:
       oldpath can specify a directory.  In this case, newpath must eithe=
r not
       exist, or it must specify an empty directory.
        (complying with POSIX_C_SOURCE >=3D 200809L)

So move should give an error: Nope:

mv A B
> tree B
B
=E2=94=9C=E2=94=80=E2=94=80 A
=E2=94=82   =E2=94=94=E2=94=80=E2=94=80 foo
=E2=94=94=E2=94=80=E2=94=80 fee

1 directory, 2 files

So mv is violating POSIX - it didn't do the rename, but moved
A under B and neither dir had to be empty.

Saying it has to follow POSIX when it doesn't appear to, seems
a bit contradictory?













Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at 36831 <at> debbugs.gnu.org:


Received: (at 36831) by debbugs.gnu.org; 3 Aug 2019 02:47:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 02 22:47:20 2019
Received: from localhost ([127.0.0.1]:58103 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1htk4m-0004gt-Bm
	for submit <at> debbugs.gnu.org; Fri, 02 Aug 2019 22:47:20 -0400
Received: from mail-pf1-f194.google.com ([209.85.210.194]:34389)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <assafgordon@HIDDEN>) id 1htk4j-0004gP-50
 for 36831 <at> debbugs.gnu.org; Fri, 02 Aug 2019 22:47:18 -0400
Received: by mail-pf1-f194.google.com with SMTP id b13so36905679pfo.1
 for <36831 <at> debbugs.gnu.org>; Fri, 02 Aug 2019 19:47:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:in-reply-to:user-agent;
 bh=hrW+hj/T1CQyt0KMd2PBk1vdu6K8RDqJ9NTgf5OT2rg=;
 b=VT323jlA+12Xg1lrlytYU6Ct6dmYgmKKNu0fGTbr+QTqlxUKpOPJwKzgNbAVt9B1c0
 lxAJp/IEEQxaMQOM9mYxwFOzY8HGjOJ3occamoXXvQgaAcPNKmRnQf/Rk1TFgy+jqMpQ
 CfLY8Vejc0R1vDmX2+DLZ18BOIEBESApPuirE5lcg5Mzo22v/qGpEWhXpKM7fr/JCDPC
 9gU/MKc3hkFjc2NcXPI7h5MSHs3xNmQg9gTtOHiEySkPxdaVz9QvUpfFSL3gzpHrc1OD
 cb5h65SCACozv6JvN8AzLQRCuPE9zKO0L/+1wBapfn9LPLM1V7Pza6iBpJNobCP+/Py4
 bqDw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:references
 :mime-version:content-disposition:in-reply-to:user-agent;
 bh=hrW+hj/T1CQyt0KMd2PBk1vdu6K8RDqJ9NTgf5OT2rg=;
 b=L8xJeawE4N6KJzuS4rbwsm+WSxobPsJBIl0sZi43xDJdAD7LKCp3gX/lwUoYFEuO3X
 UjquwRcTpRo5bmZJFsFU7FmH2G4RP/IvJiplR+6Oxr6g3gWi90xp5KCIDsF9RIcbvUT1
 x6EoMR3pe81Yx96YqyLRztGqrW4vRcJaqEdKYbns19Tj8oEuq2bUymvFeptJf0y5b5oW
 reUwchgwy0qYcsaonnjpxUwCT36IiWNYCBa1wlI/8Yw9u88YiGiPuWLExdE1WaKGtUkf
 7736CXPhwJzlOxZcuDEvBYPeWFEKaAkYoEIYmUqZrZiJVJXYdMTqQrozDHsPn6nlQXcv
 ljNQ==
X-Gm-Message-State: APjAAAX9+jBfuGvaFcDEGiYLBK/IXIGHi/2wALpOr5ONhgqZ2ctu5YKz
 JDFQnRRno2LOHDDe7EZ5JHf/1xTs
X-Google-Smtp-Source: APXvYqz0ia4o39nVyX5cPEhSD2H8N5V2d7hRLZ+ycIWBwctf2QuasEB+UzTR1Favbk4I7rTyAFGCpQ==
X-Received: by 2002:a63:5d54:: with SMTP id
 o20mr110950632pgm.413.1564800430784; 
 Fri, 02 Aug 2019 19:47:10 -0700 (PDT)
Received: from tomato (moose.housegordon.com. [184.68.105.38])
 by smtp.gmail.com with ESMTPSA id k3sm59340438pgq.92.2019.08.02.19.47.09
 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);
 Fri, 02 Aug 2019 19:47:09 -0700 (PDT)
Received: by tomato (Postfix, from userid 1000)
 id 806C368B22C; Fri,  2 Aug 2019 20:47:08 -0600 (MDT)
Date: Fri, 2 Aug 2019 20:47:08 -0600
From: Assaf Gordon <assafgordon@HIDDEN>
To: L A Walsh <coreutils@HIDDEN>
Subject: Re: Enhance directory move.  (was Re: bug#36831: enhance 'directory
 not empty' message)
Message-ID: <20190803024708.GI15401@HIDDEN>
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
 <5D44054B.3080907@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <5D44054B.3080907@HIDDEN>
User-Agent: Mutt/1.11.4 (2019-03-13)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36831
Cc: Alex Mantel <alexmantel93@HIDDEN>, Coreutils <bug-coreutils@HIDDEN>,
 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello,

On Fri, Aug 02, 2019 at 02:41:31AM -0700, L A Walsh wrote:
> On 2019/07/28 23:28, Assaf Gordon wrote:
> >
> >
> >     $ mkdir A B B/A
> >     $ touch A/bar B/A/foo
> >     $ mv A B
> >     mv: cannot move 'A' to 'B/A': Directory not empty
> >
> > And the reason (as you've found out) is that the target directory 'B/A'
> > is not empty (has the 'foo' file in it).
> > Had this been allowed, moving 'A' to 'B/A' would result in the 'foo'
> > file disappearing.
> >   
> ---
>     Why must foo disappear?
> 
>     Microsoft Windows handles this situation by telling the user that
> the target directory already exists and giving the option to *MERGE*
> the directories.
> 
>     If you attempt to move a file into a directory that already contains
> a file by the same name, it pops up another notice asking [...]

Certainly, GUI programs (and more 'feature-rich' programs than 'mv')
offer many "merging" options.

I'm sure Midnight-Commander, KDE/Doplhine, XFCE/Thunar, Gnome/Nautilus
and many other free software GUI file managers have some "merging"
capabilities.

But 'mv' is more basic and does not have this capability.
Partly that is because it adheres to the POSIX standards, which
mandates:
    "3. The mv utility shall perform actions equivalent to the
        rename() function [...]"
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/mv.html

Some rsync options (--remove-source-files) can mimick 'mv' with merging,
but then they are more like "copy+delete" than actual "rename/move".


Can new merging features be added to 'mv'? yes.
But it seems to me these would be better suited for 'higher level'
programs (e.g. a GUI file manager).

regards,
 - assaf




Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Aug 2019 02:47:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 02 22:47:15 2019
Received: from localhost ([127.0.0.1]:58100 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1htk4h-0004gb-0P
	for submit <at> debbugs.gnu.org; Fri, 02 Aug 2019 22:47:15 -0400
Received: from lists.gnu.org ([209.51.188.17]:39404)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <assafgordon@HIDDEN>) id 1htk4g-0004gS-7u
 for submit <at> debbugs.gnu.org; Fri, 02 Aug 2019 22:47:14 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:46089)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <assafgordon@HIDDEN>) id 1htk4f-0006VD-2f
 for bug-coreutils@HIDDEN; Fri, 02 Aug 2019 22:47:14 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <assafgordon@HIDDEN>) id 1htk4d-0002bC-W0
 for bug-coreutils@HIDDEN; Fri, 02 Aug 2019 22:47:13 -0400
Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:46584)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <assafgordon@HIDDEN>)
 id 1htk4d-0002ar-Q1
 for bug-coreutils@HIDDEN; Fri, 02 Aug 2019 22:47:11 -0400
Received: by mail-pf1-x441.google.com with SMTP id c3so13766993pfa.13
 for <bug-coreutils@HIDDEN>; Fri, 02 Aug 2019 19:47:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:in-reply-to:user-agent;
 bh=hrW+hj/T1CQyt0KMd2PBk1vdu6K8RDqJ9NTgf5OT2rg=;
 b=VT323jlA+12Xg1lrlytYU6Ct6dmYgmKKNu0fGTbr+QTqlxUKpOPJwKzgNbAVt9B1c0
 lxAJp/IEEQxaMQOM9mYxwFOzY8HGjOJ3occamoXXvQgaAcPNKmRnQf/Rk1TFgy+jqMpQ
 CfLY8Vejc0R1vDmX2+DLZ18BOIEBESApPuirE5lcg5Mzo22v/qGpEWhXpKM7fr/JCDPC
 9gU/MKc3hkFjc2NcXPI7h5MSHs3xNmQg9gTtOHiEySkPxdaVz9QvUpfFSL3gzpHrc1OD
 cb5h65SCACozv6JvN8AzLQRCuPE9zKO0L/+1wBapfn9LPLM1V7Pza6iBpJNobCP+/Py4
 bqDw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:references
 :mime-version:content-disposition:in-reply-to:user-agent;
 bh=hrW+hj/T1CQyt0KMd2PBk1vdu6K8RDqJ9NTgf5OT2rg=;
 b=dCjm2G08WB+0YcuZ1cV1TOb2enSVjLAUvS2UN/Mx7I6mZD2zzgkMa8SXvC3RqjUudj
 7NXHxHNGtjbPafY9x5ZupDhBF8q6aegh1uF9n6Pnv8CnqKH3YfW6tRchgHp8oljUoloe
 fHFtNfarxxKyPZ2S3Z9zAEwMi7ezmSpEKMt+5L014GK9eBUSaFUPBBW8YC7255i+CyAe
 aCxl3pbIVADe5GxWjVV+z0YPmeNnOSfhs0cW42qyilmC74RPCkrr5/7Y9Nw0GE7o93+Z
 lf74RDuwaG50KXwuNHiXx5ueqcBw5Nc1skzQvr9mo1QwGFSW3qtuOh6/dt4dlrSa6YOk
 7ffw==
X-Gm-Message-State: APjAAAWOYXFRQb6S9tYNRYvpK/ixyF6bCtjVUmgGW/7PG/rAeVnsYpGs
 H/PBNd62AGroQ7SJ9yt5jP4=
X-Google-Smtp-Source: APXvYqz0ia4o39nVyX5cPEhSD2H8N5V2d7hRLZ+ycIWBwctf2QuasEB+UzTR1Favbk4I7rTyAFGCpQ==
X-Received: by 2002:a63:5d54:: with SMTP id
 o20mr110950632pgm.413.1564800430784; 
 Fri, 02 Aug 2019 19:47:10 -0700 (PDT)
Received: from tomato (moose.housegordon.com. [184.68.105.38])
 by smtp.gmail.com with ESMTPSA id k3sm59340438pgq.92.2019.08.02.19.47.09
 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);
 Fri, 02 Aug 2019 19:47:09 -0700 (PDT)
Received: by tomato (Postfix, from userid 1000)
 id 806C368B22C; Fri,  2 Aug 2019 20:47:08 -0600 (MDT)
Date: Fri, 2 Aug 2019 20:47:08 -0600
From: Assaf Gordon <assafgordon@HIDDEN>
To: L A Walsh <coreutils@HIDDEN>
Subject: Re: Enhance directory move.  (was Re: bug#36831: enhance 'directory
 not empty' message)
Message-ID: <20190803024708.GI15401@HIDDEN>
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
 <5D44054B.3080907@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <5D44054B.3080907@HIDDEN>
User-Agent: Mutt/1.11.4 (2019-03-13)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2607:f8b0:4864:20::441
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Alex Mantel <alexmantel93@HIDDEN>, Coreutils <bug-coreutils@HIDDEN>,
 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Hello,

On Fri, Aug 02, 2019 at 02:41:31AM -0700, L A Walsh wrote:
> On 2019/07/28 23:28, Assaf Gordon wrote:
> >
> >
> >     $ mkdir A B B/A
> >     $ touch A/bar B/A/foo
> >     $ mv A B
> >     mv: cannot move 'A' to 'B/A': Directory not empty
> >
> > And the reason (as you've found out) is that the target directory 'B/A'
> > is not empty (has the 'foo' file in it).
> > Had this been allowed, moving 'A' to 'B/A' would result in the 'foo'
> > file disappearing.
> >   
> ---
>     Why must foo disappear?
> 
>     Microsoft Windows handles this situation by telling the user that
> the target directory already exists and giving the option to *MERGE*
> the directories.
> 
>     If you attempt to move a file into a directory that already contains
> a file by the same name, it pops up another notice asking [...]

Certainly, GUI programs (and more 'feature-rich' programs than 'mv')
offer many "merging" options.

I'm sure Midnight-Commander, KDE/Doplhine, XFCE/Thunar, Gnome/Nautilus
and many other free software GUI file managers have some "merging"
capabilities.

But 'mv' is more basic and does not have this capability.
Partly that is because it adheres to the POSIX standards, which
mandates:
    "3. The mv utility shall perform actions equivalent to the
        rename() function [...]"
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/mv.html

Some rsync options (--remove-source-files) can mimick 'mv' with merging,
but then they are more like "copy+delete" than actual "rename/move".


Can new merging features be added to 'mv'? yes.
But it seems to me these would be better suited for 'higher level'
programs (e.g. a GUI file manager).

regards,
 - assaf




Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at 36831 <at> debbugs.gnu.org:


Received: (at 36831) by debbugs.gnu.org; 2 Aug 2019 09:41:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 02 05:41:38 2019
Received: from localhost ([127.0.0.1]:55804 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1htU4A-0000Qx-1M
	for submit <at> debbugs.gnu.org; Fri, 02 Aug 2019 05:41:38 -0400
Received: from ishtar.tlinx.org ([173.164.175.65]:39250
 helo=Ishtar.sc.tlinx.org) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <coreutils@HIDDEN>) id 1htU48-0000Qk-51
 for 36831 <at> debbugs.gnu.org; Fri, 02 Aug 2019 05:41:36 -0400
Received: from [192.168.3.12] (Athenae [192.168.3.12])
 by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id
 x729fVk9040412; Fri, 2 Aug 2019 02:41:34 -0700
Message-ID: <5D44054B.3080907@HIDDEN>
Date: Fri, 02 Aug 2019 02:41:31 -0700
From: L A Walsh <coreutils@HIDDEN>
User-Agent: Thunderbird
MIME-Version: 1.0
To: Assaf Gordon <assafgordon@HIDDEN>
Subject: Enhance directory move.  (was Re: bug#36831: enhance 'directory not
 empty' message)
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
In-Reply-To: <20190729062807.GE2676@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36831
Cc: Alex Mantel <alexmantel93@HIDDEN>, Coreutils <bug-coreutils@HIDDEN>,
 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 2019/07/28 23:28, Assaf Gordon wrote:
>
>
>     $ mkdir A B B/A
>     $ touch A/bar B/A/foo
>     $ mv A B
>     mv: cannot move 'A' to 'B/A': Directory not empty
>
> And the reason (as you've found out) is that the target directory 'B/A'
> is not empty (has the 'foo' file in it).
> Had this been allowed, moving 'A' to 'B/A' would result in the 'foo'
> file disappearing.
>   
---
    Why must foo disappear?

    Microsoft Windows handles this situation by telling the user that
the target directory already exists and giving the option to *MERGE*
the directories.

    If you attempt to move a file into a directory that already contains
a file by the same name, it pops up another notice asking if you want
to replace the old with the new, keep it as it is (file won't be moved and
in this case, old directory would still exist with the unmoved files left
in it), or keep both with the new file getting a name variant (like
foo.exe -> foo_1.exe, keeping the extension the same so as to not mess
up the identity of the contents.

    But in all the cases, a file with a non-conflicting name wouldn't
disappear from the target.









Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Aug 2019 09:41:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 02 05:41:42 2019
Received: from localhost ([127.0.0.1]:55807 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1htU4E-0000RD-9z
	for submit <at> debbugs.gnu.org; Fri, 02 Aug 2019 05:41:42 -0400
Received: from lists.gnu.org ([209.51.188.17]:41392)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <coreutils@HIDDEN>) id 1htU4D-0000R7-Cc
 for submit <at> debbugs.gnu.org; Fri, 02 Aug 2019 05:41:41 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56099)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <coreutils@HIDDEN>) id 1htU4C-0003RI-EU
 for bug-coreutils@HIDDEN; Fri, 02 Aug 2019 05:41:41 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <coreutils@HIDDEN>) id 1htU4B-0002GF-HW
 for bug-coreutils@HIDDEN; Fri, 02 Aug 2019 05:41:40 -0400
Received: from ishtar.tlinx.org ([173.164.175.65]:47396
 helo=Ishtar.sc.tlinx.org)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <coreutils@HIDDEN>) id 1htU4B-0002G2-8j
 for bug-coreutils@HIDDEN; Fri, 02 Aug 2019 05:41:39 -0400
Received: from [192.168.3.12] (Athenae [192.168.3.12])
 by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id
 x729fVk9040412; Fri, 2 Aug 2019 02:41:34 -0700
Message-ID: <5D44054B.3080907@HIDDEN>
Date: Fri, 02 Aug 2019 02:41:31 -0700
From: L A Walsh <coreutils@HIDDEN>
User-Agent: Thunderbird
MIME-Version: 1.0
To: Assaf Gordon <assafgordon@HIDDEN>
Subject: Enhance directory move.  (was Re: bug#36831: enhance 'directory not
 empty' message)
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
In-Reply-To: <20190729062807.GE2676@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
 timestamps) [generic]
X-Received-From: 173.164.175.65
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
Cc: Alex Mantel <alexmantel93@HIDDEN>, Coreutils <bug-coreutils@HIDDEN>,
 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

On 2019/07/28 23:28, Assaf Gordon wrote:
>
>
>     $ mkdir A B B/A
>     $ touch A/bar B/A/foo
>     $ mv A B
>     mv: cannot move 'A' to 'B/A': Directory not empty
>
> And the reason (as you've found out) is that the target directory 'B/A'
> is not empty (has the 'foo' file in it).
> Had this been allowed, moving 'A' to 'B/A' would result in the 'foo'
> file disappearing.
>   
---
    Why must foo disappear?

    Microsoft Windows handles this situation by telling the user that
the target directory already exists and giving the option to *MERGE*
the directories.

    If you attempt to move a file into a directory that already contains
a file by the same name, it pops up another notice asking if you want
to replace the old with the new, keep it as it is (file won't be moved and
in this case, old directory would still exist with the unmoved files left
in it), or keep both with the new file getting a name variant (like
foo.exe -> foo_1.exe, keeping the extension the same so as to not mess
up the identity of the contents.

    But in all the cases, a file with a non-conflicting name wouldn't
disappear from the target.









Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at 36831 <at> debbugs.gnu.org:


Received: (at 36831) by debbugs.gnu.org; 2 Aug 2019 03:48:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 01 23:48:06 2019
Received: from localhost ([127.0.0.1]:55682 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1htOY2-00007P-Bf
	for submit <at> debbugs.gnu.org; Thu, 01 Aug 2019 23:48:06 -0400
Received: from mail-pg1-f179.google.com ([209.85.215.179]:46913)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <assafgordon@HIDDEN>) id 1htOXz-00006t-Rx
 for 36831 <at> debbugs.gnu.org; Thu, 01 Aug 2019 23:48:04 -0400
Received: by mail-pg1-f179.google.com with SMTP id k189so16297246pgk.13
 for <36831 <at> debbugs.gnu.org>; Thu, 01 Aug 2019 20:48:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:in-reply-to:user-agent;
 bh=ERvTmRfJySm9Vo8qjCty8vTN6Kj3Fgv+/MRYc+5sDLE=;
 b=jcMNCF0nNSYzbBMeju++kmtyb9u5xGGTQwuanH8XivH/ljA8QCveY7iBQDJeqZFBf/
 xFeNHDHlywML4kDm+RV28bJjh+tk7NwxAjvJDxBw9LYB11BU6zRHqcT0jc3KN2YxCU5M
 bQz+Ro6fBKf7SCnsywHngF68dMASwL11JngqkuVuk68dSdKeiPzOb8VRi8LNpWN0+q1S
 diD3CDgH0rBtw1v8Iqr9DqpaJHIb1mKWNxWNKecfEDIGC1RFvFsZgqtB++y6sJf+S27q
 wL3cte6JYmfHFAaT6KHshLEJgskrB+eGfU5jXybT8lOQ5qJ3X6OGBRYrwI1uV8kspIXK
 xe6Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:references
 :mime-version:content-disposition:in-reply-to:user-agent;
 bh=ERvTmRfJySm9Vo8qjCty8vTN6Kj3Fgv+/MRYc+5sDLE=;
 b=QC1e+LMGC6GMA0MDD/yPZ3+bkbe/BhwH40hY/UWWD0q2a1ZrG1eBtqDX/5JS/O0/a3
 nrYM18wd1ZQ9xvd8Q/0D/n0lmXBb2V+mCLlKzEy3Mwe4tjF28y4uNUhSuQI0VfooFolP
 0fTBNrcvNUlSLtc35evioSO6u4KOCqfcAIjr7M1BU4Lxs0dzEeNP42ZB6A5fCHPKVLRB
 ihhYFxvalS3aRhL4Wr4r+IXzHOZhwg10NC78Hb/B5x+FZyU4WHys/n+mch/uwox+JFCi
 gmB2tmFqAcO1mT/zKH2r+ffq4XLGSKPfHAUW2VzVn5kQ7mUkUTkfQVi+uRaZev3z8ZS0
 1YzQ==
X-Gm-Message-State: APjAAAWJ6o51lomnnrLE196w2ox5lFZH/sMfIn8d+qwa3XGieUTnwry/
 ipJlMnTJrwVFuz+nqfE0rcU=
X-Google-Smtp-Source: APXvYqyYg/nHZRzEMNeBY3phQcyVaIddfXmKYChjOQM15n2xVx3+jhVdLNRzrnamv7A24XH/SB0qBg==
X-Received: by 2002:a17:90a:2163:: with SMTP id
 a90mr2091303pje.3.1564717677836; 
 Thu, 01 Aug 2019 20:47:57 -0700 (PDT)
Received: from tomato (moose.housegordon.com. [184.68.105.38])
 by smtp.gmail.com with ESMTPSA id d8sm67581142pgh.45.2019.08.01.20.47.55
 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);
 Thu, 01 Aug 2019 20:47:55 -0700 (PDT)
Received: by tomato (Postfix, from userid 1000)
 id CB2D1681D4E; Thu,  1 Aug 2019 21:47:54 -0600 (MDT)
Date: Thu, 1 Aug 2019 21:47:54 -0600
From: Assaf Gordon <assafgordon@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#36831: enhance 'directory not empty' message
Message-ID: <20190802034754.GE15401@HIDDEN>
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
 <4834fd10-a997-44a1-e732-b8ccc669f217@HIDDEN>
 <20190731220505.GA9062@HIDDEN>
 <f9b94be4-13da-26cd-710e-2046030f8449@HIDDEN>
 <20190801101500.GB15401@HIDDEN>
 <306d6614-3b99-2f63-432b-355aebdca258@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="k3qmt+ucFURmlhDS"
Content-Disposition: inline
In-Reply-To: <306d6614-3b99-2f63-432b-355aebdca258@HIDDEN>
User-Agent: Mutt/1.11.4 (2019-03-13)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36831
Cc: Alex Mantel <alexmantel93@HIDDEN>, 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--k3qmt+ucFURmlhDS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Aug 01, 2019 at 03:58:51PM -0700, Paul Eggert wrote:
> Thanks, that's better, but we're still missing some opportunities for improvement.
> 
> >     mv: cannot move 'A' to 'B/A': Target directory not empty
> 
> This should be "Destination" not "Target". 
[...] 
> You meant "mv" not "rm".
[...]
> > +static char*
> Space before "*".
[...]
> > +strerror_target (int e)
> Change name to "strerror_dest"
[...] 
> This function should return NULL instead of aborting when the errno value is
> inapplicable. That way, its callers need not hardcode which errno values it
> handles.

Thanks for the review and suggestions - attached an updated patch.

> Come to think of it, the same improvement should be made to ln, cp, install
> and shred. Basically, to any program that uses 'rename' or 'link' or similar
> syscalls, and which reports an error if the syscall fails.

OK, I will work on that next.

-assaf

--k3qmt+ucFURmlhDS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="0001-mv-improve-error-messages-when-destination-directory.patch"

From 8dc6158a6fde668e55312b5fb69384f438b7e55a Mon Sep 17 00:00:00 2001
From: Assaf Gordon <assafgordon@HIDDEN>
Date: Mon, 29 Jul 2019 00:23:20 -0600
Subject: [PATCH] mv: improve error messages when destination directory is at
 fault

Suggested by Alex Mantel <alexmantel93@HIDDEN> in
https://bugs.gnu.org/36831 .

    $ mkdir A B B/A
    $ touch A/bar B/A/foo

Before:

    $ mv A B
    mv: cannot move 'A' to 'B/A': Directory not empty

After:

    $ mv A B
    mv: cannot move 'A' to 'B/A': Destination directory not empty

The following errors are handled:
EDQUOT, EEXIST, ENOTEMPTY, EISDIR, ENOSPC, ETXTBSY.

* src/copy.c (copy_internal): Print custom messages for errors
that explicitly fault the destination directory.
(strerror_dest): New function, return custom, translatable error
messages for errors relating to 'destination' component.
* tests/mv/dir2dir.sh: Adjust expected error message.
* NEWS: Mention change.
---
 NEWS                |  6 +++++
 src/copy.c          | 53 ++++++++++++++++++++++++++++++++++++++++++---
 tests/mv/dir2dir.sh |  8 ++++---
 3 files changed, 61 insertions(+), 6 deletions(-)

diff --git a/NEWS b/NEWS
index fd0543351..3d80665ae 100644
--- a/NEWS
+++ b/NEWS
@@ -44,6 +44,12 @@ GNU coreutils NEWS                                    -*- outline -*-
   stat(1) also supports a new --cached= option to control cache
   coherency of file system attributes, useful on network file systems.
 
+** Improvements
+
+  mv now prints clearer error messages when a failure relates to the
+  destination directory (e.g., "Destination directory is not empty" instead
+  of "Directory not empty").
+
 
 * Noteworthy changes in release 8.31 (2019-03-10) [stable]
 
diff --git a/src/copy.c b/src/copy.c
index 65cf65895..602c8307b 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -1867,6 +1867,44 @@ source_is_dst_backup (char const *srcbase, struct stat const *src_st,
   return dst_back_status == 0 && SAME_INODE (*src_st, dst_back_sb);
 }
 
+/* Return custom error messages replacing the default libc's
+   messages. These messages explicity fault the destination component
+   in the error.
+
+   Return NULL if E (errno value) is not handled (and by implication
+   should use the system's default text for the error message).  */
+static char *
+strerror_dest (int e)
+{
+  /* TRANSLATORS: These strings should mimick libc's standard
+     error messages (from strerror(3)), but explicitly mention
+     the fault is with the destination directory. */
+  switch (errno)
+    {
+    case EDQUOT:
+      return _("Disk quota exceeded on destination device");
+    case EEXIST:
+    case ENOTEMPTY:
+      return _("Destination directory not empty");
+    case EISDIR:
+      return _("Tried to overwrite a directory with a file");
+    case ENOSPC:
+      return _("No space left on destination device");
+    case ETXTBSY:
+      /* NOTE: The error is "Text file busy" - but "text" in that context
+         refers to "text segment" of an executable file (as opposed to
+         "data segment" and "BSS segment").
+
+         This error message is meant for users, and 'text file' can be easily
+         confused with an actual text file (i.e., one containing only ASCII
+         characters. Thus, say 'executable' instead of 'text'.*/
+      return _("Destination executable file is busy");
+    default:
+      return NULL;
+    }
+}
+
+
 /* Copy the file SRC_NAME to the file DST_NAME.  The files may be of
    any type.  NEW_DST should be true if the file DST_NAME cannot
    exist because its parent directory was just created; NEW_DST should
@@ -2477,9 +2515,18 @@ copy_internal (char const *src_name, char const *dst_name,
              If the permissions on the directory containing the source or
              destination file are made too restrictive, the rename will
              fail.  Etc.  */
-          error (0, rename_errno,
-                 _("cannot move %s to %s"),
-                 quoteaf_n (0, src_name), quoteaf_n (1, dst_name));
+
+          const char *custom_err_msg = strerror_dest (rename_errno);
+          if (custom_err_msg)
+            error (0, 0,
+                   _("cannot move %s to %s: %s"),
+                   quoteaf_n (0, src_name), quoteaf_n (1, dst_name),
+                   custom_err_msg) ;
+          else
+            error (0, rename_errno,
+                   _("cannot move %s to %s"),
+                   quoteaf_n (0, src_name), quoteaf_n (1, dst_name));
+
           forget_created (src_sb.st_ino, src_sb.st_dev);
           return false;
         }
diff --git a/tests/mv/dir2dir.sh b/tests/mv/dir2dir.sh
index 6455386b9..869f624a3 100755
--- a/tests/mv/dir2dir.sh
+++ b/tests/mv/dir2dir.sh
@@ -30,11 +30,13 @@ touch a/t/f || framework_failure_
 mv b/t a 2> out && fail=1
 
 # Accept any of these: EEXIST, ENOTEMPTY, EBUSY.
-sed             's/: File exists/: Directory not empty/'<out>o1;mv o1 out
-sed 's/: Device or resource busy/: Directory not empty/'<out>o1;mv o1 out
+sed             's/: File exists/: Destination directory not empty/'<out>o1
+mv o1 out
+sed 's/: Device or resource busy/: Destination directory not empty/'<out>o1
+mv o1 out
 
 cat <<\EOF > exp || framework_failure_
-mv: cannot move 'b/t' to 'a/t': Directory not empty
+mv: cannot move 'b/t' to 'a/t': Destination directory not empty
 EOF
 
 compare exp out || fail=1
-- 
2.20.1


--k3qmt+ucFURmlhDS--




Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at 36831 <at> debbugs.gnu.org:


Received: (at 36831) by debbugs.gnu.org; 1 Aug 2019 22:59:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 01 18:59:04 2019
Received: from localhost ([127.0.0.1]:55624 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1htK2K-0001hr-2m
	for submit <at> debbugs.gnu.org; Thu, 01 Aug 2019 18:59:04 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:32940)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1htK2H-0001hM-Ft
 for 36831 <at> debbugs.gnu.org; Thu, 01 Aug 2019 18:59:02 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id DD2EE16186B;
 Thu,  1 Aug 2019 15:58:54 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id B0uGPxO-gwhb; Thu,  1 Aug 2019 15:58:54 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 30BB91626BA;
 Thu,  1 Aug 2019 15:58:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id h2Scq_56y7un; Thu,  1 Aug 2019 15:58:54 -0700 (PDT)
Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com
 [23.242.74.103])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 088BC16186B;
 Thu,  1 Aug 2019 15:58:54 -0700 (PDT)
Subject: Re: bug#36831: enhance 'directory not empty' message
To: Assaf Gordon <assafgordon@HIDDEN>
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
 <4834fd10-a997-44a1-e732-b8ccc669f217@HIDDEN>
 <20190731220505.GA9062@HIDDEN>
 <f9b94be4-13da-26cd-710e-2046030f8449@HIDDEN>
 <20190801101500.GB15401@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <306d6614-3b99-2f63-432b-355aebdca258@HIDDEN>
Date: Thu, 1 Aug 2019 15:58:51 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.8.0
MIME-Version: 1.0
In-Reply-To: <20190801101500.GB15401@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36831
Cc: Alex Mantel <alexmantel93@HIDDEN>, 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Thanks, that's better, but we're still missing some opportunities for improvement.

 >     mv: cannot move 'A' to 'B/A': Target directory not empty

This should be "Destination" not "Target". (A target directory is something 
different; this is merely a destination directory.) Similar changes need to be 
made uniformly throughout the patch.


 > +** Improvements
 > +
 > +  rm now prints clearer error messages when a failure relates to the

You meant "mv" not "rm".

Come to think of it, the same improvement should be made to ln, cp, install and 
shred. Basically, to any program that uses 'rename' or 'link' or similar 
syscalls, and which reports an error if the syscall fails.

 > +static char*

Space before "*".

 > +strerror_target (int e)

Change name to "strerror_dest" or something like that, to be consistent with the 
terminology "destination" rather than "target".

This function should return NULL instead of aborting when the errno value is 
inapplicable. That way, its callers need not hardcode which errno values it handles.




Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at 36831 <at> debbugs.gnu.org:


Received: (at 36831) by debbugs.gnu.org; 1 Aug 2019 10:15:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 01 06:15:13 2019
Received: from localhost ([127.0.0.1]:53502 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ht876-0004R5-Lr
	for submit <at> debbugs.gnu.org; Thu, 01 Aug 2019 06:15:13 -0400
Received: from mail-pl1-f194.google.com ([209.85.214.194]:45553)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <assafgordon@HIDDEN>) id 1ht874-0004Qo-7a
 for 36831 <at> debbugs.gnu.org; Thu, 01 Aug 2019 06:15:10 -0400
Received: by mail-pl1-f194.google.com with SMTP id y8so32019893plr.12
 for <36831 <at> debbugs.gnu.org>; Thu, 01 Aug 2019 03:15:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:in-reply-to:user-agent;
 bh=kkdAzQzPi5fptgcgtKih/G2uHBrtM9cQBf8cEqWANdQ=;
 b=vh8xBgD8/3P2AZUA+X5kdX9TU3vSS4vKnkSek4kpXtHMM7hZQSutjezmpTidRWvWXw
 t7T71x5gSQl2wzS4se5RoC5Mh29Cax/Pb4bBMdOcVme1TsbFh1gerzAwvotOFalCdPpq
 1jmF+KzbkCbhNxm16P7thLYNsk6rBKqhP2p2cF3rCwsMib2XoDTodY/F9iAg10pioXS7
 cZktVgPQC/+DXf1+HrleT58cMI+/IPpCOd2X9PnuQZ290DnN49BmSqnZMUhRyyMadX3q
 Ai5qAkmxoP2Bg7jIhBaf5RF8rgWhwwng3SbU196gW1z6YSaxy36GgpMxE9U7OzYo7/4Q
 wbmg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:references
 :mime-version:content-disposition:in-reply-to:user-agent;
 bh=kkdAzQzPi5fptgcgtKih/G2uHBrtM9cQBf8cEqWANdQ=;
 b=QRZcBowOL9vZOelZ/QW7GS2LAwG41H36h08D2yWWXozEa2bNZRlJW25r/1jpXxUxEr
 rGXivvJpfIAQRZvR5Vciber0IQOhd0PCdcgC+LommEx/U2nYnBgO3xx9vlkIhRjrcy3c
 x6szhFTzrDxaYatPySsBewokREXPA3+diE4g1X+eRCSQUHPuUoRE9QbKOhsjCOmMRDkO
 98r+rPxO991Xndbtg5Ns+CiigigkEF7EjJpGVtO1kxgP2krYo6McnNc9Mjkuj9vHrsJ/
 zXZhaET/yw6T6XKo+qM8ztamEDWM74AQ3EFUaSOTYOXWHrJjQkQqV5xMeTd6YtuDpil1
 GjnA==
X-Gm-Message-State: APjAAAU1vJDqroeXUSpa1d0tD7p1tBOcZ70zl7qZaZ3jlYEvsYAqzEGg
 V83+Hx4bske4MVGtG/4UN2s=
X-Google-Smtp-Source: APXvYqzo6Qw9sStx9gicAJExAwGglZnco3ZA9afHk05fS21aTRSYo2Ijq/t8X1czStyA5WCrWA8eGg==
X-Received: by 2002:a17:902:788f:: with SMTP id
 q15mr127289352pll.236.1564654504169; 
 Thu, 01 Aug 2019 03:15:04 -0700 (PDT)
Received: from tomato (moose.housegordon.com. [184.68.105.38])
 by smtp.gmail.com with ESMTPSA id u1sm67673463pgi.28.2019.08.01.03.15.01
 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);
 Thu, 01 Aug 2019 03:15:02 -0700 (PDT)
Received: by tomato (Postfix, from userid 1000)
 id 06889681985; Thu,  1 Aug 2019 04:15:01 -0600 (MDT)
Date: Thu, 1 Aug 2019 04:15:00 -0600
From: Assaf Gordon <assafgordon@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#36831: enhance 'directory not empty' message
Message-ID: <20190801101500.GB15401@HIDDEN>
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
 <4834fd10-a997-44a1-e732-b8ccc669f217@HIDDEN>
 <20190731220505.GA9062@HIDDEN>
 <f9b94be4-13da-26cd-710e-2046030f8449@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="+pHx0qQiF2pBVqBT"
Content-Disposition: inline
In-Reply-To: <f9b94be4-13da-26cd-710e-2046030f8449@HIDDEN>
User-Agent: Mutt/1.11.4 (2019-03-13)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36831
Cc: Alex Mantel <alexmantel93@HIDDEN>, 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--+pHx0qQiF2pBVqBT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hello,

On Wed, Jul 31, 2019 at 08:03:45PM -0700, Paul Eggert wrote:
> Assaf Gordon wrote:
> > An explicit error explicitly saying "cannot move", and mention the source and
> > destination, and also "blames" the target directory seems the most
> > user-friendly and least ambiguous.
> 
> Sure, but that handles only the ENOTEMPTY/EEXIST case. How would you handle
> the EDQUOT, EISDIR, and ENOSPC cases? Will you invent a separate diagnostic
> for each case, or just treat them as in my proposed patch? I assume the
> latter, but either way I'd like to see a patch that handles these properly
> too. Also, please handle ETXTBUSY while you're at it (sorry, I missed that
> one).
> 
> > For the second and third cases,
> > "No space" and "Quota exceeded" seem to me to always relate to the
> > destination, and I don't think users get confused about those
> > (other opinions of course welcomed).
> 
> What's obvious to experts like us is not always obvious to users. If users
> get confused by the current diagnostic for ENOTEMPTY/EEXIST, I don't see why
> they wouldn't also get confused for ETXTBUSY etc.
> 
> > Your patch also added "EISDIR", for which rename(2) says:
> >  "newpath is an existing directory, but oldpath is not a directory."
> > 
> > But I don't think this error can happen with gnu mv.
> 
> It can, as a result of a race condition if some other process is mutating
> the file system while 'mv' is running. Admittedly unlikely, but we might as
> well improve this errno value while we're improving the others.

All good points.

Please see attached updated version.

It does add explicit error string for each error code, but I hope the
implementation is reasonable and easy to maintain and translate.

-assaf

--+pHx0qQiF2pBVqBT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="0001-mv-improve-error-messages-when-target-directory-is-a.patch"

From 8ee71b24d74d7cfe81f151de430d38935cf04675 Mon Sep 17 00:00:00 2001
From: Assaf Gordon <assafgordon@HIDDEN>
Date: Mon, 29 Jul 2019 00:23:20 -0600
Subject: [PATCH] mv: improve error messages when target directory is at fault

Suggested by Alex Mantel <alexmantel93@HIDDEN> in
https://bugs.gnu.org/36831 .

    $ mkdir A B B/A
    $ touch A/bar B/A/foo

Before:

    $ mv A B
    mv: cannot move 'A' to 'B/A': Directory not empty

After:

    $ mv A B
    mv: cannot move 'A' to 'B/A': Target directory not empty

The following errors are handled:
EDQUOT, EEXIST, ENOTEMPTY, EISDIR, ENOSPC, ETXTBSY.

* src/copy.c (copy_internal): Print custom messages for errors
that explicitly fault the target directory.
(strerror_target): New function, return custom and translatable error
messages.
* tests/mv/dir2dir.sh: Adjust expected error message.
* NEWS: Mention change.
---
 NEWS                |  6 +++++
 src/copy.c          | 56 ++++++++++++++++++++++++++++++++++++++++++---
 tests/mv/dir2dir.sh |  6 ++---
 3 files changed, 62 insertions(+), 6 deletions(-)

diff --git a/NEWS b/NEWS
index fd0543351..4ec4d0df0 100644
--- a/NEWS
+++ b/NEWS
@@ -44,6 +44,12 @@ GNU coreutils NEWS                                    -*- outline -*-
   stat(1) also supports a new --cached= option to control cache
   coherency of file system attributes, useful on network file systems.
 
+** Improvements
+
+  rm now prints clearer error messages when a failure relates to the
+  target directory (e.g., "Target directory is not empty" instead of
+  "Directory not empty").
+
 
 * Noteworthy changes in release 8.31 (2019-03-10) [stable]
 
diff --git a/src/copy.c b/src/copy.c
index 65cf65895..9cf02ad9c 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -1867,6 +1867,38 @@ source_is_dst_backup (char const *srcbase, struct stat const *src_st,
   return dst_back_status == 0 && SAME_INODE (*src_st, dst_back_sb);
 }
 
+static char*
+strerror_target (int e)
+{
+  /* TRANSLATORS: These strings should mimick libc's standard
+     error messages (from strerror(3)), but explicitly mention
+     the fault is with the target directory. */
+  switch (errno)
+    {
+    case EDQUOT:
+      return _("Disk quota exceeded on target device");
+    case EEXIST:
+    case ENOTEMPTY:
+      return _("Target directory not empty");
+    case EISDIR:
+      return _("Tried to overwrite a directory with a file");
+    case ENOSPC:
+      return _("No space left on target device");
+    case ETXTBSY:
+      /* NOTE: The error is "Text file busy" - but "text" in that context
+         refers to "text segment" of an executable file (as opposed to
+         "data segment" and "BSS segment").
+
+         This error message is meant for users, and 'text file' can be easily
+         confused with an actual text file (i.e., one containing only ASCII
+         characters. Thus, say 'executable' instead of 'text'.*/
+      return _("Target executable file is busy");
+    default:
+      assert (0);
+    }
+}
+
+
 /* Copy the file SRC_NAME to the file DST_NAME.  The files may be of
    any type.  NEW_DST should be true if the file DST_NAME cannot
    exist because its parent directory was just created; NEW_DST should
@@ -2477,9 +2509,27 @@ copy_internal (char const *src_name, char const *dst_name,
              If the permissions on the directory containing the source or
              destination file are made too restrictive, the rename will
              fail.  Etc.  */
-          error (0, rename_errno,
-                 _("cannot move %s to %s"),
-                 quoteaf_n (0, src_name), quoteaf_n (1, dst_name));
+
+          switch (errno)
+            {
+            case EDQUOT:
+            case EEXIST:
+            case ENOTEMPTY:
+            case EISDIR:
+            case ENOSPC:
+            case ETXTBSY:
+              error (0, 0,
+                     _("cannot move %s to %s: %s"),
+                     quoteaf_n (0, src_name), quoteaf_n (1, dst_name),
+                     strerror_target (rename_errno));
+              break;
+
+            default:
+              error (0, rename_errno,
+                     _("cannot move %s to %s"),
+                     quoteaf_n (0, src_name), quoteaf_n (1, dst_name));
+              break;
+            }
           forget_created (src_sb.st_ino, src_sb.st_dev);
           return false;
         }
diff --git a/tests/mv/dir2dir.sh b/tests/mv/dir2dir.sh
index 6455386b9..62ed8ce46 100755
--- a/tests/mv/dir2dir.sh
+++ b/tests/mv/dir2dir.sh
@@ -30,11 +30,11 @@ touch a/t/f || framework_failure_
 mv b/t a 2> out && fail=1
 
 # Accept any of these: EEXIST, ENOTEMPTY, EBUSY.
-sed             's/: File exists/: Directory not empty/'<out>o1;mv o1 out
-sed 's/: Device or resource busy/: Directory not empty/'<out>o1;mv o1 out
+sed             's/: File exists/: Target directory not empty/'<out>o1;mv o1 out
+sed 's/: Device or resource busy/: Target directory not empty/'<out>o1;mv o1 out
 
 cat <<\EOF > exp || framework_failure_
-mv: cannot move 'b/t' to 'a/t': Directory not empty
+mv: cannot move 'b/t' to 'a/t': Target directory not empty
 EOF
 
 compare exp out || fail=1
-- 
2.20.1


--+pHx0qQiF2pBVqBT--




Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Aug 2019 08:32:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 01 04:32:24 2019
Received: from localhost ([127.0.0.1]:53449 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ht6Vb-0008KI-W0
	for submit <at> debbugs.gnu.org; Thu, 01 Aug 2019 04:32:24 -0400
Received: from lists.gnu.org ([209.51.188.17]:53653)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <auerswal@HIDDEN>) id 1ht6Va-0008KA-MM
 for submit <at> debbugs.gnu.org; Thu, 01 Aug 2019 04:32:23 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:53184)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <auerswal@HIDDEN>) id 1ht6VZ-000127-Ga
 for bug-coreutils@HIDDEN; Thu, 01 Aug 2019 04:32:22 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <auerswal@HIDDEN>) id 1ht6VY-0007Mk-Fy
 for bug-coreutils@HIDDEN; Thu, 01 Aug 2019 04:32:21 -0400
Received: from mailgw1.uni-kl.de ([2001:638:208:120::220]:54952)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <auerswal@HIDDEN>)
 id 1ht6VY-0007Jz-8O
 for bug-coreutils@HIDDEN; Thu, 01 Aug 2019 04:32:20 -0400
Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de
 [IPv6:2001:638:208:ef34:0:ff:fe00:65])
 by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id
 x718W9oU186561
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <bug-coreutils@HIDDEN>; Thu, 1 Aug 2019 10:32:09 +0200
Received: from sushi.unix-ag.uni-kl.de (ip6-localhost [IPv6:::1])
 by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id
 x718W9bE024290
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO)
 for <bug-coreutils@HIDDEN>; Thu, 1 Aug 2019 10:32:09 +0200
Received: (from auerswal@localhost)
 by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Submit) id x718W9o3024289
 for bug-coreutils@HIDDEN; Thu, 1 Aug 2019 10:32:09 +0200
Date: Thu, 1 Aug 2019 10:32:09 +0200
From: Erik Auerswald <auerswal@HIDDEN>
To: bug-coreutils@HIDDEN
Subject: Re: bug#36831: enhance 'directory not empty' message
Message-ID: <20190801083209.GB20813@HIDDEN>
Mail-Followup-To: Erik Auerswald <auerswal@HIDDEN>,
 bug-coreutils@HIDDEN
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
 <4834fd10-a997-44a1-e732-b8ccc669f217@HIDDEN>
 <20190731220505.GA9062@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20190731220505.GA9062@HIDDEN>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:638:208:120::220
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

On Wed, Jul 31, 2019 at 04:05:05PM -0600, Assaf Gordon wrote:
> On Mon, Jul 29, 2019 at 06:50:46PM -0500, Paul Eggert wrote:
> > On 7/29/19 1:28 AM, Assaf Gordon wrote:
> > > +      if (rename_errno == ENOTEMPTY || rename_errno == EEXIST)
> > > +        {
> > > +          error (0, 0, _("cannot move %s to %s: Target directory not empty"),
> > > +                 quoteaf_n (0, src_name), quoteaf_n (1, dst_name));
> > 
> > Although this is an improvement, it is not general enough, as other errno
> > values are relevant only for the destination. Better would be to have a
> > special case for errno values that matter only for the destination, and use
> > the existing code for errno values where we don't know whether the problem
> > is the source or the destination. Something like the attached, say.
> 
> > +            case EDQUOT: case EEXIST: case EISDIR: case ENOSPC: case ENOTEMPTY:
> > +              error (0, rename_errno, "%s", quotearg_colon (dst_name));
> > +              break;
> > +
> 
> [...]
> An explicit error explicitly saying "cannot move", and mention the source and
> destination, and also "blames" the target directory seems the most
> user-friendly and least ambiguous.

I agree with this reasoning and prefer Assaf's error message improvement.

Thanks,
Erik
-- 
If you're willing to restrict the flexibility of your approach,
you can almost always do something better.
                        -- John Carmack




Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at 36831 <at> debbugs.gnu.org:


Received: (at 36831) by debbugs.gnu.org; 1 Aug 2019 03:03:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 31 23:03:54 2019
Received: from localhost ([127.0.0.1]:53342 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ht1Ni-0000ak-8e
	for submit <at> debbugs.gnu.org; Wed, 31 Jul 2019 23:03:54 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:58860)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1ht1Ng-0000aX-Ha
 for 36831 <at> debbugs.gnu.org; Wed, 31 Jul 2019 23:03:53 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 7BCB81626EF;
 Wed, 31 Jul 2019 20:03:46 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id QJOVkuql1My5; Wed, 31 Jul 2019 20:03:45 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id B66071626FE;
 Wed, 31 Jul 2019 20:03:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id YiJDLpbTt1hf; Wed, 31 Jul 2019 20:03:45 -0700 (PDT)
Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com
 [23.242.74.103])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 8DB0D1626EF;
 Wed, 31 Jul 2019 20:03:45 -0700 (PDT)
Subject: Re: bug#36831: enhance 'directory not empty' message
To: Assaf Gordon <assafgordon@HIDDEN>
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
 <4834fd10-a997-44a1-e732-b8ccc669f217@HIDDEN>
 <20190731220505.GA9062@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
Message-ID: <f9b94be4-13da-26cd-710e-2046030f8449@HIDDEN>
Date: Wed, 31 Jul 2019 20:03:45 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.8.0
MIME-Version: 1.0
In-Reply-To: <20190731220505.GA9062@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36831
Cc: Alex Mantel <alexmantel93@HIDDEN>, 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Assaf Gordon wrote:
> An explicit error explicitly saying "cannot move", and mention the source and
> destination, and also "blames" the target directory seems the most
> user-friendly and least ambiguous.

Sure, but that handles only the ENOTEMPTY/EEXIST case. How would you handle the 
EDQUOT, EISDIR, and ENOSPC cases? Will you invent a separate diagnostic for each 
case, or just treat them as in my proposed patch? I assume the latter, but 
either way I'd like to see a patch that handles these properly too. Also, please 
handle ETXTBUSY while you're at it (sorry, I missed that one).

> For the second and third cases,
> "No space" and "Quota exceeded" seem to me to always relate to the
> destination, and I don't think users get confused about those
> (other opinions of course welcomed).

What's obvious to experts like us is not always obvious to users. If users get 
confused by the current diagnostic for ENOTEMPTY/EEXIST, I don't see why they 
wouldn't also get confused for ETXTBUSY etc.

> Your patch also added "EISDIR", for which rename(2) says:
>  "newpath is an existing directory, but oldpath is not a directory."
> 
> But I don't think this error can happen with gnu mv.

It can, as a result of a race condition if some other process is mutating the 
file system while 'mv' is running. Admittedly unlikely, but we might as well 
improve this errno value while we're improving the others.




Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at 36831 <at> debbugs.gnu.org:


Received: (at 36831) by debbugs.gnu.org; 31 Jul 2019 22:38:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 31 18:38:33 2019
Received: from localhost ([127.0.0.1]:53239 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hsxEu-0006kQ-Tm
	for submit <at> debbugs.gnu.org; Wed, 31 Jul 2019 18:38:33 -0400
Received: from mout.kundenserver.de ([217.72.192.75]:55745)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1hsxEs-0006kD-D3
 for 36831 <at> debbugs.gnu.org; Wed, 31 Jul 2019 18:38:30 -0400
Received: from [192.168.101.10] ([91.1.209.190]) by mrelayeu.kundenserver.de
 (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id
 1Mlvmv-1iaquN3ivz-00j4AK; Thu, 01 Aug 2019 00:38:13 +0200
Subject: Re: bug#36831: enhance 'directory not empty' message
To: Assaf Gordon <assafgordon@HIDDEN>, Paul Eggert <eggert@HIDDEN>
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
 <4834fd10-a997-44a1-e732-b8ccc669f217@HIDDEN>
 <20190731220505.GA9062@HIDDEN>
From: Bernhard Voelker <mail@HIDDEN>
Openpgp: preference=signencrypt
Autocrypt: addr=mail@HIDDEN; prefer-encrypt=mutual; keydata=
 mQENBFPirzMBCACyzYldTjQ4ufFOkByY5Nn5USb5GFoL48nWBwNHjd9KUbtRRNlQiPNKd6hK
 Gvd3BGi5aoFKA4ytfRk6jbAbW3jVb3R8wYaV08mOy4KVEKxqN4bxsXlMjNChXVR+rtKDmfI+
 oPTL+cPH2X6gW4W02IRbVw0uUhNm6zEedC/gNrY/mTlf1enZ46jxZ7BTUZaG+kx38UMISIMB
 zSzLRtdkwgmHj4jS3p1fF2cwRqLclIfMjKGpbNFPEXeXKWrCLcqHw78795eAR9q0YvrDkfIn
 GdDBwfb3VM4NdulwIFzvYZMSXvSbbyPLB5YkHU5aAWQHUse4WlfT5ccDpbzUYldRAvF9ABEB
 AAG0K0Jlcm5oYXJkIFZvZWxrZXIgPG1haWxAYmVybmhhcmQtdm9lbGtlci5kZT6JATkEEwEC
 ACMFAlPirzMCGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRBGUC73lpFxle5wCACC
 dbs0QaJ0vR3Sff2cKdTk41rUq3YfWngsR///IOU0C5DdkePmCnJE/lUsUy0LRTxcUDLxQR+x
 QHU8ssRT0JUO9726dI3miy36UdsgmBYaOtLvQcidGmW1R7o0PYYf04+TFtyqKgngOUBPpMgR
 6o4UsQxy/OD4bN1WDqOgIjL+D/qJpkKmgp6L6+hhaBCpiOFKRmmV7YyQ3SqVlfQNiHs5ZtkR
 nXpIjgZARV+GllKucI17bO0CGmTJZ1tstVy0+W3DQT1lbBkTTc++5LONM99D3jjn23l1ocOp
 folR53F7I4cb2RNfT23v1I59RH37lB9wMOqrKj0UjYAC2YoPGQ3BuQENBFPirzMBCADXLWWp
 QihBldY6reca8ZKdc3T9qXEOa3akE3DWKztIBmNJhtYOjmpLYajQTkGa7UoJTnbmZE2Rn6ZE
 oNnvb0gcFNAIcY95KOI+bjOR8HEgh4cx2REXh6L6olIgyXqt/KFusE4wtVZAFxZl+30HzN6n
 D+1HvrjXxPJRX6MsIYOYyyX9/6OofwJK6QHODYGp8WL2olHDnmsXg4AT6Wlr7qKpKrQELlcF
 R4xkvdmgL/Ghw/tK0yJTxMIcewCCZWLPOXRmFRbvAadZWPAgVsJ63siNyUlVnVMSzDgTJl+s
 l/DMabXpqrJQx3/1Yy6mTaDs3XZT/wmBKaTLXx/LByaPxQQ7ABEBAAGJAR8EGAECAAkFAlPi
 rzMCGwwACgkQRlAu95aRcZWVPwgAqZT6iTXkoP37wYb41323RzhBcJ8JSk4cyBDBUXX0lMrM
 3qhiClKG7phpxVdu817Gwc6Hsecg7FfjQAV8MHQ0ZFeEFdk3b2rKBqfsStc+h49/xF3Fb+if
 CzR9qeQF82fMSxkg18++7hMcHCMO/hPZ/Q0xRi+lrSr2QKDJQuLzSyVU14TxrCkevZjEhtma
 VNvcJlJzCbiBXee9Fpc5jITUXPFG8E8dxqo1n+duOyIMgozrAnzP7X5V/Ob/Ozf/aGGX9+Jd
 inyfCX18nWcHALKMU/36Eua/ylalf/2c2YkBp9KCLVmGgPkUgW52EeRPgroIsiwu+rwCSV6Z
 UyCJ+OymCg==
Message-ID: <fb7c3ddc-43c3-0dbb-5cb0-b80bfc384155@HIDDEN>
Date: Thu, 1 Aug 2019 00:38:10 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.8.0
MIME-Version: 1.0
In-Reply-To: <20190731220505.GA9062@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K1:yq3w3P4MGRA2dOKyzgd2RDGQYzD1yfB92ub0s/+0e+mObSWYNYi
 8FVhUd/KR60hYN4u2SnA2R6IPYqQkmbKTu2wgSe+YONdBMwjeJkuHPGBK8ucu5lZrMzTHzX
 i6+ecj4xlxrq8vtcT3sGyGbyKzkztzVzyTZ692Xagbg+MyYrcvjIcdnL/Mqz/UpjzrM5MzJ
 nMo7AQ1Si7DqpGWVksdjA==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:0xPC1gyJ6vk=:khpnr6RUQjkikm71z0MdpK
 M21tAX0zezkX43I0uavq9rv7W3EJ4A9iZ8Trw/xtCFG6NgHKC1wDbcu694LCoRYe01ASKMxfN
 LwvKy+sfHDb+JqVH/uFJZp2WUYfZFhpnfynlRhG3wGzsptazAPUm6nZX8y9gRmfS+TjP+3FdJ
 aZlDJoxLzl9+QFwssSF5D8tVl/OeMElFlMyjtkKk5TM+W1UIdDpGF4ALlWIZhjnco/Doq8U7W
 4iuFaUnJIZ0g3HbzZ880pPRt9Pvbu3WCjk0zOwZxuuhseDD+mInZ+9rn3Dk08BVDE6Rhr2S2x
 hs6g0kuAGUgTh/G1o75/t4SAtqFlEzTxcVF68ZCibV8vz8o2kgQBsVVG9nii2qwezvSsOcSR3
 VSP0tZ2Z4toNZmHIIwg+BqtLOte+W3dpzi9h9CGy3O+KceJtRvOnoYB1W4hTb6YqreexWyXr8
 h3DmMy+gOk6Xq3TTLzX5LolOalQtVUxVYsBXHBWQ1TvFpdzSVBf0gkONAe/IuKb6ohNqxVLAU
 Fa/tTe2T0tItDdB1Q0FZo0D4P5Hkn/ci/qmuF1zxUasVqkk8tmaj6KE3+nJJkHF2jv9qCLrtr
 ktM8mnhZiDvqkHwaRbcaDN9fCye3pMgXpUh6+/J/5w50KI8qLbMowzMT1ut59j+DZJ/hV+ix3
 CczbLtJj3nJKupy5Uj3T9w9VROcVBAg+wSKixNQALjSHoZj65MkqKroeCfyafdYfwBLSrMQHm
 sEoelvTT94M4rKr5lLgr/7yxS0VU00sYTgl8RPgbwR6IkxekABKzhi8AIBhUaJJ03ioADStNd
 jk4rM5L
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36831
Cc: Alex Mantel <alexmantel93@HIDDEN>, 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 8/1/19 12:05 AM, Assaf Gordon wrote:
> Happy to hear your opinion,

+1
Including the full context about an error is essential:
- what did the tool try to do (at that point)?
- what was the problem? (e.g. ENOTEMPTY)
- where was the problem: src or dst?

Thanks & have a nice day,
Berny




Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at 36831 <at> debbugs.gnu.org:


Received: (at 36831) by debbugs.gnu.org; 31 Jul 2019 22:05:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 31 18:05:14 2019
Received: from localhost ([127.0.0.1]:53217 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hswig-0005qW-HC
	for submit <at> debbugs.gnu.org; Wed, 31 Jul 2019 18:05:14 -0400
Received: from mail-pg1-f195.google.com ([209.85.215.195]:39872)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <assafgordon@HIDDEN>) id 1hswif-0005qH-H3
 for 36831 <at> debbugs.gnu.org; Wed, 31 Jul 2019 18:05:13 -0400
Received: by mail-pg1-f195.google.com with SMTP id u17so32745541pgi.6
 for <36831 <at> debbugs.gnu.org>; Wed, 31 Jul 2019 15:05:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:in-reply-to:user-agent;
 bh=N6tnpxNtkmBWqWsDjasiPbyqdagDwHT+/fx4J7c71/c=;
 b=F4RfG4K+pB/fDwep9679aHrSw6zGLdZu5g2uNJcpWkvh8iiiQAbE6JHany89KcJe6K
 KfWm7ZdU2bgh+0+r83J91PSFrykvpEu+YEqUC8H+VfcC0/CrSZr/4mVowDW1NNaTV7h0
 mk1JEEq8Hl82IERVHglpVPz4JxSnZQUkxMN+DcGE7ultymnA+S7s2F/RvMzcnU2DnAwK
 qhVrnEhpkl/9E2nLeybd5FccSDP4lzJTKEfPneZeVeXS/0dj09QN3N02rSKuTcM3jqu0
 TSMKfykEdY1xvE0zRzXgOcSKlO+WKsPY5x4Vk7w1EPcEYITX/tqEaBXPZYM6NRgZWacf
 3Qrg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:references
 :mime-version:content-disposition:in-reply-to:user-agent;
 bh=N6tnpxNtkmBWqWsDjasiPbyqdagDwHT+/fx4J7c71/c=;
 b=PGPhaiywfTgVHSd5M7FSZlNkMIXzAIi2NNMPWZkI8TqZcNNOfdLD2k1G9KIDDp9Go9
 SxsJ2JbKCuSyB30jj0rWDtGSphP2BY3VnrjvsfnCxdVQjD3faxLjymIt+n2gdT/WULHN
 3tqOk/djse8BD8zH1QumaiBldnvPj1dR8lLpDZq3hxuCBoR0+spq17P3nHQjDiPa2RiQ
 wnSgEFFA3dfW52JXsjenq/YU5mja5PwavF5EuvE1oNFm8MCBMJelgPVlxd4etFbOdyut
 PyV44kCJG5U7LFH5U3J8DDERnr/jnTkI/sLyDMMxNKTNOxB+1Rjk2G6F61rQZRi93ZEy
 oo6A==
X-Gm-Message-State: APjAAAUawnCdroSMG+6K+3gc45ay9PkEQ4tQMHXwQLNa0iI6V2K27j6+
 +W3xXPyV1DjvfmiAswaZuuQ=
X-Google-Smtp-Source: APXvYqx61lprukHvYAcQstAaodWX+9KBytDT+e1cRiU3k2ZBDcZUEl/NeZu2l16GIx6bO5cQfgWOJQ==
X-Received: by 2002:a63:5c07:: with SMTP id q7mr63245653pgb.436.1564610707635; 
 Wed, 31 Jul 2019 15:05:07 -0700 (PDT)
Received: from tomato (moose.housegordon.com. [184.68.105.38])
 by smtp.gmail.com with ESMTPSA id 30sm3612235pjk.17.2019.07.31.15.05.06
 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);
 Wed, 31 Jul 2019 15:05:06 -0700 (PDT)
Received: by tomato (Postfix, from userid 1000)
 id 713D368431D; Wed, 31 Jul 2019 16:05:05 -0600 (MDT)
Date: Wed, 31 Jul 2019 16:05:05 -0600
From: Assaf Gordon <assafgordon@HIDDEN>
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#36831: enhance 'directory not empty' message
Message-ID: <20190731220505.GA9062@HIDDEN>
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
 <4834fd10-a997-44a1-e732-b8ccc669f217@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4834fd10-a997-44a1-e732-b8ccc669f217@HIDDEN>
User-Agent: Mutt/1.11.4 (2019-03-13)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36831
Cc: Alex Mantel <alexmantel93@HIDDEN>, 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello Paul,

On Mon, Jul 29, 2019 at 06:50:46PM -0500, Paul Eggert wrote:
> On 7/29/19 1:28 AM, Assaf Gordon wrote:
> > +      if (rename_errno == ENOTEMPTY || rename_errno == EEXIST)
> > +        {
> > +          error (0, 0, _("cannot move %s to %s: Target directory not empty"),
> > +                 quoteaf_n (0, src_name), quoteaf_n (1, dst_name));
> 
> Although this is an improvement, it is not general enough, as other errno
> values are relevant only for the destination. Better would be to have a
> special case for errno values that matter only for the destination, and use
> the existing code for errno values where we don't know whether the problem
> is the source or the destination. Something like the attached, say.

> +            case EDQUOT: case EEXIST: case EISDIR: case ENOSPC: case ENOTEMPTY:
> +              error (0, rename_errno, "%s", quotearg_colon (dst_name));
> +              break;
> +

Thanks for the review.

At the risk of bikeshedding, I'd like to argue for the prior method.
While it is not general enough, I think it provides a clearer error message.

For example, with the more general implementation the errors would be:

  $ mv A B
  mv: B/A: Directory not empty

  $ mv A B
  mv: B/A: No space left on device

  $ mv A B
  mv: B/A: Quota exceeded

In the first case,
I think this error is potentially more confusing than
before: while it doesn't mention the source directory, it also doesn't
say "cannot move" - so it is only implied it is an error (an
inexperienced user might dismiss this as a warning).

Also, it could be that there will be a source directory named very similarly
to the destination directory, and from a quick glace it would not be easy to
understand what happened.

An explicit error explicitly saying "cannot move", and mention the source and
destination, and also "blames" the target directory seems the most
user-friendly and least ambiguous.

---

For the second and third cases,
"No space" and "Quota exceeded" seem to me to always relate to the
destination, and I don't think users get confused about those
(other opinions of course welcomed).

---

Your patch also added "EISDIR", for which rename(2) says:
 "newpath is an existing directory, but oldpath is not a directory."

But I don't think this error can happen with gnu mv.
If we try to move a file onto a directory, we get:

  $ mkdir C C/D ; touch D
  $ mv D C
  mv: cannot overwrite directory 'C/D' with non-directory

And this case is specifically handled in copy.c line 2131, before
calling rename(2)  (and also this is an example of a custom error
message instead of using stock libc messages).

---

Happy to hear your opinion,
 - assaf






Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at 36831 <at> debbugs.gnu.org:


Received: (at 36831) by debbugs.gnu.org; 29 Jul 2019 23:50:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 29 19:50:57 2019
Received: from localhost ([127.0.0.1]:49322 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hsFPt-0006PS-9l
	for submit <at> debbugs.gnu.org; Mon, 29 Jul 2019 19:50:57 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:40264)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1hsFPq-0006PC-8y
 for 36831 <at> debbugs.gnu.org; Mon, 29 Jul 2019 19:50:55 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id F043516183C;
 Mon, 29 Jul 2019 16:50:47 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id VLD16h320VyR; Mon, 29 Jul 2019 16:50:47 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3F279162621;
 Mon, 29 Jul 2019 16:50:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id mgNsavyfe-Cc; Mon, 29 Jul 2019 16:50:47 -0700 (PDT)
Received: from [192.168.0.8] (ip72-206-6-38.fv.ks.cox.net [72.206.6.38])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id DD8AB16183C;
 Mon, 29 Jul 2019 16:50:46 -0700 (PDT)
Subject: Re: bug#36831: enhance 'directory not empty' message
To: Assaf Gordon <assafgordon@HIDDEN>, Alex Mantel <alexmantel93@HIDDEN>
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Message-ID: <4834fd10-a997-44a1-e732-b8ccc669f217@HIDDEN>
Date: Mon, 29 Jul 2019 18:50:46 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.8.0
MIME-Version: 1.0
In-Reply-To: <20190729062807.GE2676@HIDDEN>
Content-Type: multipart/mixed; boundary="------------7420DB5B8BA501D59331D4B4"
Content-Language: en-US
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36831
Cc: 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

This is a multi-part message in MIME format.
--------------7420DB5B8BA501D59331D4B4
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

On 7/29/19 1:28 AM, Assaf Gordon wrote:
> +      if (rename_errno == ENOTEMPTY || rename_errno == EEXIST)
> +        {
> +          error (0, 0, _("cannot move %s to %s: Target directory not empty"),
> +                 quoteaf_n (0, src_name), quoteaf_n (1, dst_name));

Although this is an improvement, it is not general enough, as other 
errno values are relevant only for the destination. Better would be to 
have a special case for errno values that matter only for the 
destination, and use the existing code for errno values where we don't 
know whether the problem is the source or the destination. Something 
like the attached, say.



--------------7420DB5B8BA501D59331D4B4
Content-Type: text/x-patch;
 name="mv.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="mv.diff"

diff --git a/src/copy.c b/src/copy.c
index 65cf65895..b1e4557e4 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -2477,9 +2477,18 @@ copy_internal (char const *src_name, char const *dst_name,
              If the permissions on the directory containing the source or
              destination file are made too restrictive, the rename will
              fail.  Etc.  */
-          error (0, rename_errno,
-                 _("cannot move %s to %s"),
-                 quoteaf_n (0, src_name), quoteaf_n (1, dst_name));
+          switch (errno)
+            {
+            case EDQUOT: case EEXIST: case EISDIR: case ENOSPC: case ENOTEMPTY:
+              error (0, rename_errno, "%s", quotearg_colon (dst_name));
+              break;
+
+            default:
+              error (0, rename_errno,
+                     _("cannot move %s to %s"),
+                     quoteaf_n (0, src_name), quoteaf_n (1, dst_name));
+              break;
+            }
           forget_created (src_sb.st_ino, src_sb.st_dev);
           return false;
         }

--------------7420DB5B8BA501D59331D4B4--




Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at 36831 <at> debbugs.gnu.org:


Received: (at 36831) by debbugs.gnu.org; 29 Jul 2019 07:25:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 29 03:25:43 2019
Received: from localhost ([127.0.0.1]:47637 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hs02R-0003oQ-63
	for submit <at> debbugs.gnu.org; Mon, 29 Jul 2019 03:25:43 -0400
Received: from mail-wm1-f43.google.com ([209.85.128.43]:55130)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <meyering@HIDDEN>) id 1hs02P-0003oA-0M
 for 36831 <at> debbugs.gnu.org; Mon, 29 Jul 2019 03:25:41 -0400
Received: by mail-wm1-f43.google.com with SMTP id p74so52771442wme.4
 for <36831 <at> debbugs.gnu.org>; Mon, 29 Jul 2019 00:25:40 -0700 (PDT)
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=mllvLm9fUq+SDdG/Eu7c4T1Wgz9nBXBnVIHF71armlg=;
 b=gzbSqoD9ZsrISHbsQh9Ptmu1t3HTNM1YbitoQnUe9uWk3NWfGljEi6zg6vPbI0BKai
 qma7CU9KPZEQ4sTdQowj178U5C4KyYZrKLPBo6jWFo74RUTGbPoenXgX8rkTKQSS0p9H
 NzTpZhf2eYMSRwUOk89a5pUrVri2Opic4JsSGBfmTp2K8x57h5xdseIKUeUi4gefyflV
 PUZuMuqOJXOVTtlLqG1Jgj2qxYLxIYQKdR8ajbH2gpRGRTUn7WX4d8bVdbLCkdZQmzPJ
 vOgym1mCHfJItu0hzNgaxNovKv1xcYxFIvo3m760ehriap5KN9yEuXDTTxUNWiMnYDHd
 1CmA==
X-Gm-Message-State: APjAAAXPPPWvUKVo2otH6eoAhUQw8aStynHme4TWs739mAaCoYu/Xckx
 x0dUFeLPwNl3A3m87pXiFJ930XYMK5e9sQQsNSA=
X-Google-Smtp-Source: APXvYqxjk/DOAQekEji/SmfgFC58vZgBHP3Aathmauy+y9AVpymu2hmneZQubmxQWHxVTN1vx8TPy9uhtQ91mh94Yuo=
X-Received: by 2002:a1c:a8c9:: with SMTP id
 r192mr100616465wme.43.1564385135140; 
 Mon, 29 Jul 2019 00:25:35 -0700 (PDT)
MIME-Version: 1.0
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
 <20190729062807.GE2676@HIDDEN>
In-Reply-To: <20190729062807.GE2676@HIDDEN>
From: Jim Meyering <jim@HIDDEN>
Date: Mon, 29 Jul 2019 00:25:23 -0700
Message-ID: <CA+8g5KGD8rhuBfV67G3T7z34k8wuuAo7TfpoHWv0ob2WVRT-Jw@HIDDEN>
Subject: Re: bug#36831: enhance 'directory not empty' message
To: Assaf Gordon <assafgordon@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 36831
Cc: Alex Mantel <alexmantel93@HIDDEN>, 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

On Sun, Jul 28, 2019 at 11:29 PM Assaf Gordon <assafgordon@HIDDEN> wrote:
...
> What do others think? If this is a desired improvement, I'll finish the
> patch with news/tests/etc.
...
> [PATCH] mv: improve ENOTEMPTY/EEXIST error message
>
> Suggested by Alex Mantel <alexmantel93@HIDDEN> in
> https://bugs.gnu.org/36831 .
>
>     $ mkdir A B B/A
>     $ touch A/bar B/A/foo
>
> Before:
>
>     $ mv A B
>     mv: cannot move 'A' to 'B/A': Directory not empty
>
> After:
>
>     $ mv A B
>     mv: cannot move 'A' to 'B/A': Target directory not empty
>
> * src/copy.c (copy_internal): Add special handling for ENOTEMPTY/EEXIST.
> TODO: NEWS, tests.

I like it. Thank you.




Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at 36831 <at> debbugs.gnu.org:


Received: (at 36831) by debbugs.gnu.org; 29 Jul 2019 06:28:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 29 02:28:19 2019
Received: from localhost ([127.0.0.1]:47596 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hrz8t-0002Mn-6M
	for submit <at> debbugs.gnu.org; Mon, 29 Jul 2019 02:28:19 -0400
Received: from mail-pg1-f169.google.com ([209.85.215.169]:40472)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <assafgordon@HIDDEN>) id 1hrz8r-0002Mb-3V
 for 36831 <at> debbugs.gnu.org; Mon, 29 Jul 2019 02:28:17 -0400
Received: by mail-pg1-f169.google.com with SMTP id w10so27702477pgj.7
 for <36831 <at> debbugs.gnu.org>; Sun, 28 Jul 2019 23:28:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:content-transfer-encoding:in-reply-to
 :user-agent; bh=LBG8jokQCN0oGhnQ7ApFBW+/zoO4GrkG+/DZ8VGqmsE=;
 b=EzL/ajvFxSwfmIkKR6y1NnBVcjm67/NBM5eUcGIFUivucN4vNLNzDgZVMzHoO+TplV
 g0nDvlax4uombdeOW2oweMujWbOZ1PdPjUsosaU3DynS+Gux5vpAjLhinTQ+0iQlxNGy
 sFw+WCEsbJCv4s5VTX5mHGQcniaUyvKXN7jUvB3QC5XTZD/2ZH1Y/6mqwTnOqBdfIhyo
 0Pu1u7ESBHH3fAQVHoIR9lmRxiV47aEqNgf+dsF8cTXD5D3FDdudiSsOFsirWU4/pL6y
 fx9fb3b1BYKyJqPnConHU9Gwruqjhb7KC0koiTey3AjDr1bs6P2PaPsrV5c8gDLIB2VA
 iPsg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:references
 :mime-version:content-disposition:content-transfer-encoding
 :in-reply-to:user-agent;
 bh=LBG8jokQCN0oGhnQ7ApFBW+/zoO4GrkG+/DZ8VGqmsE=;
 b=eIL33XxV/VSo/MR+k9vwmUCWdjmIYQisAT5LgI/Wh/U7vaA5dJbQKPCacLNAzgouRE
 E/BI0XnJ0d76eAzMzbyedDyUxog2Ov842qh0VusSpuK+A1WS1hhmKBtLdAk8Bde2S0Sg
 GCB0v812vqFFWXq3Jr24PaInbtY/eeyfHTFrkU2+6K+a8vNm2Yfh549etre8pgXAelyi
 hU2H/s/juxFn2WUrcb/h6UtFEMSMXj7t+VydAPvWX2ef9dTNuO6Ug6PxOEIVs5K4k/x4
 J0svpdvaWCy8yMuDYLTr5p7Ae4zkoxauHrZRnbcAXAaaYlfsunjaLCTaGRt6eik+t3Tp
 JKJw==
X-Gm-Message-State: APjAAAU5eOmxlgW0LhlEYyeqqTd1kXItClohz93k012H0BbzkO+oRlvq
 lvLA/lj+MWRBlzp3f/C48KgJGn/v
X-Google-Smtp-Source: APXvYqzVNguux3Q4mX7Ke8pjqhMjU74hphIu2KZwQTv9v4pnslsA4WrtdNIAk0pKNIkT/a3/ARAqiQ==
X-Received: by 2002:a17:90a:9301:: with SMTP id
 p1mr109959312pjo.22.1564381690555; 
 Sun, 28 Jul 2019 23:28:10 -0700 (PDT)
Received: from tomato (moose.housegordon.com. [184.68.105.38])
 by smtp.gmail.com with ESMTPSA id b30sm86635409pfr.117.2019.07.28.23.28.08
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Sun, 28 Jul 2019 23:28:08 -0700 (PDT)
Received: by tomato (Postfix, from userid 1000)
 id AA33A680D44; Mon, 29 Jul 2019 00:28:07 -0600 (MDT)
Date: Mon, 29 Jul 2019 00:28:07 -0600
From: Assaf Gordon <assafgordon@HIDDEN>
To: Alex Mantel <alexmantel93@HIDDEN>
Subject: Re: bug#36831: enhance 'directory not empty' message
Message-ID: <20190729062807.GE2676@HIDDEN>
References: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="24zk1gE8NUlDmwG9"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
User-Agent: Mutt/1.11.4 (2019-03-13)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36831
Cc: 36831 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--24zk1gE8NUlDmwG9
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

Hello,

On Sun, Jul 28, 2019 at 08:58:59PM +0200, Alex Mantel wrote:
[...] 
> Ah, the target directory does exist! Hmm... But i'd like the message to be
> like:
> 
>    $ mv thing/ ../things
>    mv: cannot move 'thing' to '../things/things': Targetdirectory not empty
> 
>                                                   ^ this little thing here,
>                                                     it explains everyting.
> 
> Change text from 'Directory not empty' to 'Targetdirectory not empty'.

Thanks for the report.

To clarify, the scenario is:

    $ mkdir A B B/A
    $ touch A/bar B/A/foo
    $ mv A B
    mv: cannot move 'A' to 'B/A': Directory not empty

And the reason (as you've found out) is that the target directory 'B/A'
is not empty (has the 'foo' file in it).
Had this been allowed, moving 'A' to 'B/A' would result in the 'foo'
file disappearing.

---

How is a user expecting to know this error is about that target
directory?

There is a bit of a trade-off here between user-friendliness (especially
for non-technical user) and more technical knowledge.
If we go one step 'lower' to the programming interface, almost all
sources mention this is about the 'target' directory not being empty:

POSIX's says:
https://pubs.opengroup.org/onlinepubs/009695399/functions/rename.html
    [EEXIST] or [ENOTEMPTY]
        The link named by new is a directory that is not an empty directory.

Linux's rename(2) manual page says:
    ENOTEMPTY or EEXIST
        newpath is a nonempty directory, that is, contains entries
        other than "." and "..".

FreeBSD's rename(2) manual page says:
    [ENOTEMPTY]        The to argument is a directory and is not empty.

AIX rename(2) manual page says:
     ENOTEMPTY
       The ToPath parameter specifies an existing directory that is
       not empty.


So there is some merit in claiming this helpful piece of information is
lost when the error message is reported to the user.

---

In GNU coreutils this error message originates from 'copy.c' line 2480:
https://git.savannah.gnu.org/cgit/coreutils.git/tree/src/copy.c#n2480

    error (0, rename_errno,
              _("cannot move %s to %s"),
              quoteaf_n (0, src_name), quoteaf_n (1, dst_name));

And herein lies the (technical) problem: The actual message "Directory
not empty" is not in the source code - it is a system error message
that corresponds to the value of 'rename_errno' variable
(ENOTEMPTY/EEXIST). It originates from GLibc (or another libc).

So there is no trivial way to change the error message in coreutils.

Attached a patch to add special handling for this error.

---

What do others think? If this is a desired improvement, I'll finish the
patch with news/tests/etc.


regards,
 - assaf

--24zk1gE8NUlDmwG9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="0001-mv-improve-ENOTEMPTY-EEXIST-error-message.patch"

From 430b30104234db719bf15e6fc681a62312c7124f Mon Sep 17 00:00:00 2001
From: Assaf Gordon <assafgordon@HIDDEN>
Date: Mon, 29 Jul 2019 00:23:20 -0600
Subject: [PATCH] mv: improve ENOTEMPTY/EEXIST error message

Suggested by Alex Mantel <alexmantel93@HIDDEN> in
https://bugs.gnu.org/36831 .

    $ mkdir A B B/A
    $ touch A/bar B/A/foo

Before:

    $ mv A B
    mv: cannot move 'A' to 'B/A': Directory not empty

After:

    $ mv A B
    mv: cannot move 'A' to 'B/A': Target directory not empty

* src/copy.c (copy_internal): Add special handling for ENOTEMPTY/EEXIST.
TODO: NEWS, tests.
---
 src/copy.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/copy.c b/src/copy.c
index 65cf65895..a5af570bf 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -2450,6 +2450,14 @@ copy_internal (char const *src_name, char const *dst_name,
           return true;
         }
 
+      if (rename_errno == ENOTEMPTY || rename_errno == EEXIST)
+        {
+          error (0, 0, _("cannot move %s to %s: Target directory not empty"),
+                 quoteaf_n (0, src_name), quoteaf_n (1, dst_name));
+          forget_created (src_sb.st_ino, src_sb.st_dev);
+          return false;
+        }
+
       /* WARNING: there probably exist systems for which an inter-device
          rename fails with a value of errno not handled here.
          If/as those are reported, add them to the condition below.
-- 
2.11.0


--24zk1gE8NUlDmwG9--




Information forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Jul 2019 20:28:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 28 16:28:19 2019
Received: from localhost ([127.0.0.1]:47231 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hrpmE-0002ze-QS
	for submit <at> debbugs.gnu.org; Sun, 28 Jul 2019 16:28:19 -0400
Received: from lists.gnu.org ([209.51.188.17]:60179)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alexmantel93@HIDDEN>) id 1hroNg-0004Wp-72
 for submit <at> debbugs.gnu.org; Sun, 28 Jul 2019 14:58:52 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:38767)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <alexmantel93@HIDDEN>) id 1hroNe-00005V-Tx
 for bug-coreutils@HIDDEN; Sun, 28 Jul 2019 14:58:52 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_40,
 FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,URIBL_BLOCKED
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <alexmantel93@HIDDEN>) id 1hroNd-0006oM-P1
 for bug-coreutils@HIDDEN; Sun, 28 Jul 2019 14:58:50 -0400
Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:37628)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <alexmantel93@HIDDEN>)
 id 1hroNd-0006nI-GS
 for bug-coreutils@HIDDEN; Sun, 28 Jul 2019 14:58:49 -0400
Received: by mail-ed1-x52e.google.com with SMTP id w13so57458061eds.4
 for <bug-coreutils@HIDDEN>; Sun, 28 Jul 2019 11:58:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=to:from:subject:message-id:date:user-agent:mime-version
 :content-language;
 bh=7kDi5fFd3isXSwWfk43SYE4N6QYi3s0lpb238ERMQu8=;
 b=GfDuumdI+y2gLGgWpOqFpR+q6Psaa07OeUAsTdStsfcs1AylH8B2hUG1NDQM131nZE
 OfhvBLZTXrGYRr1jAIu6SMzTlZt4n/yi/96yixFrhC+LX6RUcjVCgTOa9nPLIR5SFfUd
 93uauiqBX4TlMNMjrTrPEiYZQpW9Q10vkf2EKjxPEf1XiEvNPD1PKwnX400xlIzqAxSZ
 Y7HfUi4GX/TPQElkD0zWvaXQMHdgFr6AZL54Vbde6+NzfNARdP9yBXXpoz4Ns3akcmLm
 RJactnuopzxGZLQdpSecpA3KnZvidwrBPr9SbF5yrRxVdcI97h6vXHKF+zrCrR1yjuh9
 zF2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:to:from:subject:message-id:date:user-agent
 :mime-version:content-language;
 bh=7kDi5fFd3isXSwWfk43SYE4N6QYi3s0lpb238ERMQu8=;
 b=gCHRaSAtfexyMST9pA9kV0ljuFNlC/qJPvbeWMxo3C7K3MYoVtVDBY9N+6nX4UbQGE
 oUyl9+7EmVYswgBQz2sbfF1zGmIu2haP46LQ1wXcNh+TxodW98YAOL3lbctE6lxtI/vg
 MOP2ERmtUAhGe1Q74L+HxALHHThM+pJCFTOyPnsgriW2dwtdbAHjrrmQAA2KjqSd/O1S
 qU6JvqcYOEceprpQaFrbxf08LJevtQPvNAusR7ijLMBEYTlOiF7n0RZYWbckEgrTjMBf
 vU5H/q1dNeCZ9ALgub39pzciXkZAJIFBLDF8uJGgPKvN1HHCUUYBoedr2xRPCdM3hB0w
 3fRg==
X-Gm-Message-State: APjAAAWvjd6q7LfseaMijvEEH/koje1CFYNd8Q9lpuWex6wbeWzIJ+71
 1nf8UChmFsWkTb0xIeaE8j4ymAUG
X-Google-Smtp-Source: APXvYqw0folWMPSpwAV03kS3UBMEMuMi5xDkf56qL0PCT8NE5OoyQKFjZfGVyax9Mnegm2BU7xsebg==
X-Received: by 2002:a50:ac24:: with SMTP id v33mr92544554edc.30.1564340327615; 
 Sun, 28 Jul 2019 11:58:47 -0700 (PDT)
Received: from ?IPv6:2001:16b8:68cb:0:62f6:77ff:febe:55f5?
 (200116b868cb000062f677fffebe55f5.dip.versatel-1u1.de.
 [2001:16b8:68cb:0:62f6:77ff:febe:55f5])
 by smtp.gmail.com with ESMTPSA id b30sm15889988ede.88.2019.07.28.11.58.46
 for <bug-coreutils@HIDDEN>
 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128);
 Sun, 28 Jul 2019 11:58:46 -0700 (PDT)
To: bug-coreutils@HIDDEN
From: Alex Mantel <alexmantel93@HIDDEN>
Subject: enhance 'directory not empty' message
Message-ID: <cb555fd7-efe3-3a00-5ce9-2b15e6ff5243@HIDDEN>
Date: Sun, 28 Jul 2019 20:58:59 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.7.2
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="------------D5E3B0345694F4B70C03080A"
Content-Language: en-US-large
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2a00:1450:4864:20::52e
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sun, 28 Jul 2019 16:28:17 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

This is a multi-part message in MIME format.
--------------D5E3B0345694F4B70C03080A
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

i couldn't use move:

     $ mv thing/ ../things
     mv: cannot move 'thing' to '../things/things': Directory not empty

An i can not move it. i do not understand why. I have to google and find
at stackoverflow:

     Though its man page doesn't document it, mv will refuse to rename a
     directory to another directory if the target directory contains files.
     This is a good thing in your case because you turn out to want to
     merge the content of the source into the target, which mv will not do.

https://askubuntu.com/questions/269775/mv-directory-not-empty

Ah, the target directory does exist! Hmm... But i'd like the message to 
be like:

    $ mv thing/ ../things
    mv: cannot move 'thing' to '../things/things': Targetdirectory not empty

                                                   ^ this little thing here,
                                                     it explains everyting.

Change text from 'Directory not empty' to 'Targetdirectory not empty'.


--------------D5E3B0345694F4B70C03080A
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><font face="Bitstream Vera Sans Mono">i couldn't use move: <br>
        <br>
            $ mv thing/ ../things<br>
            mv: cannot move 'thing' to '../things/things': Directory not
        empty<br>
        <br>
        An i can not move it. i do not understand why. I have to google
        and find <br>
        at stackoverflow:<br>
        <br>
            Though its man page doesn't document it, mv will refuse to
        rename a <br>
            directory to another directory if the target directory
        contains files. <br>
            This is a good thing in your case because you turn out to
        want to <br>
            merge the content of the source into the target, which mv
        will not do.<br>
        <br>
           
        <a class="moz-txt-link-freetext" href="https://askubuntu.com/questions/269775/mv-directory-not-empty">https://askubuntu.com/questions/269775/mv-directory-not-empty</a><br>
        <br>
        Ah, the target directory does exist! Hmm... But i'd like the
        message to be like:<br>
        <br>
           $ mv thing/ ../things<br>
           mv: cannot move 'thing' to '../things/things':
        Targetdirectory not empty<br>
         <br>
                                                          ^ this little
        thing here,<br>
                                                            it explains
        everyting.<br>
        <br>
        Change text from 'Directory not empty' to 'Targetdirectory not
        empty'.<br>
      </font></p>
  </body>
</html>

--------------D5E3B0345694F4B70C03080A--




Acknowledgement sent to Alex Mantel <alexmantel93@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#36831; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.