From unknown Sat Sep 13 23:19:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9823: request for more correct error reporting of mv Resent-From: francky.leyn@telenet.be Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 21 Oct 2011 12:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 9823 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 9823@debbugs.gnu.org Cc: Francky Leyn X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.131920127214369 (code B ref -1); Fri, 21 Oct 2011 12:48:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Oct 2011 12:47:52 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RHEVr-0003jh-C5 for submit@debbugs.gnu.org; Fri, 21 Oct 2011 08:47:51 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RHEVo-0003jT-IE for submit@debbugs.gnu.org; Fri, 21 Oct 2011 08:47:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RHEUW-00079j-SI for submit@debbugs.gnu.org; Fri, 21 Oct 2011 08:46:29 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:59647) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RHEUW-00079f-Qn for submit@debbugs.gnu.org; Fri, 21 Oct 2011 08:46:28 -0400 Received: from eggs.gnu.org ([140.186.70.92]:36285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RHEUW-0002cD-2R for bug-coreutils@gnu.org; Fri, 21 Oct 2011 08:46:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RHEUT-00079M-LW for bug-coreutils@gnu.org; Fri, 21 Oct 2011 08:46:28 -0400 Received: from jacques.telenet-ops.be ([195.130.132.50]:48170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RHEUT-00079A-8u for bug-coreutils@gnu.org; Fri, 21 Oct 2011 08:46:25 -0400 Received: from zcsnocm01.telenet-ops.be ([213.224.144.65]) by jacques.telenet-ops.be with bizsmtp id nQmN1h00g1QsfP10JQmNtc; Fri, 21 Oct 2011 14:46:22 +0200 Date: Fri, 21 Oct 2011 14:46:22 +0200 (CEST) From: francky.leyn@telenet.be Message-ID: <811033761.11500631319201182097.JavaMail.root@thulani.telenet-ops.be> In-Reply-To: <1442758164.11500441319201156258.JavaMail.root@thulani.telenet-ops.be> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_637777_593171305.1319201182096" X-Originating-IP: [178.117.196.98] X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.6 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) ------=_Part_637777_593171305.1319201182096 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hello, if one uses mv to move a directory, and the target dir already exists, mv reports "Directory not empty". I find this misleading. The message should also contain the message "target dir already exists" or something similar. Best regards, Francky ------=_Part_637777_593171305.1319201182096 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

Hello,

 

if one uses mv to move a directory, and the target dir already

exists, mv reports "Directory not empty".

 

I find this misleading. The message should also contain the

message "target dir already exists" or something similar.

 

Best regards,

 

Francky

------=_Part_637777_593171305.1319201182096-- From unknown Sat Sep 13 23:19:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9823: request for more correct error reporting of mv Resent-From: Eric Blake Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 21 Oct 2011 13:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9823 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: francky.leyn@telenet.be Cc: Francky Leyn , 9823@debbugs.gnu.org Received: via spool by 9823-submit@debbugs.gnu.org id=B9823.131920204715675 (code B ref 9823); Fri, 21 Oct 2011 13:01:02 +0000 Received: (at 9823) by debbugs.gnu.org; 21 Oct 2011 13:00:47 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RHEiM-00044l-SL for submit@debbugs.gnu.org; Fri, 21 Oct 2011 09:00:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RHEiK-00044S-6w; Fri, 21 Oct 2011 09:00:46 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9LCxNPx004189 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 21 Oct 2011 08:59:24 -0400 Received: from [10.3.113.158] (ovpn-113-158.phx2.redhat.com [10.3.113.158]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p9LCxN13024060; Fri, 21 Oct 2011 08:59:23 -0400 Message-ID: <4EA16CAA.2060806@redhat.com> Date: Fri, 21 Oct 2011 06:59:22 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Fedora/3.1.15-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.4 Thunderbird/3.1.15 MIME-Version: 1.0 References: <811033761.11500631319201182097.JavaMail.root@thulani.telenet-ops.be> In-Reply-To: <811033761.11500631319201182097.JavaMail.root@thulani.telenet-ops.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Spam-Score: -10.3 (----------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.3 (----------) tag 9823 moreinfo thanks On 10/21/2011 06:46 AM, francky.leyn@telenet.be wrote: > > > Hello, > > > > if one uses mv to move a directory, and the target dir already > > exists, mv reports "Directory not empty". Can you please show a shell session that sets up the necessary paths and the actual command you typed that resulted in this message? A shell transcript will make it possible for us to repeat your actions and analyze them, much more so than a vague paraphrased English description. For example, I tried this, and it didn't give an error: $ rm -rf ? $ mkdir a b $ touch b/c $ mv a b but it did move a to become b/a. Meanwhile, I can use a GNU extension to reproduce your error message: $ rm -rf ? $ mkdir a b $ touch b/c $ mv -T a b mv: cannot move `a' to `b': Directory not empty But to me, this gives me an expected error - directory b is not empty, therefore the syscall rename("a","b") is required to fail by POSIX, and POSIX states that the failure will be either EEXIST or ENOTEMPTY (Linux chose ENOTEMPTY) - so mv is faithfully reporting the strerror() value of the actual error encountered. It's not possible to change the strerror() database, and printing a message not in the strerror() database can be confusing to developers that have come to expect specific output for specific errno values. > I find this misleading. The message should also contain the > > message "target dir already exists" or something similar. So it sounds like you'd prefer it if the message were for EEXIST instead of ENOTEMPTY? Have you tried to take it up with the Linux kernel folks? Or maybe coreutils could add a special case that if rename() fails with ENOTEMPTY and the conditions are right, then convert the errno to EEXIST before calling strerror(). But is it worth the minor pessimization (we do have precedence for some errno massaging, but it tends to need good justification)? mv -T is seldom called in the first place, since it is not POSIX. Or did you encounter a scenario with this error message without using GNU extensions? -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org From unknown Sat Sep 13 23:19:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9823: request for more correct error reporting of mv Resent-From: Eric Blake Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 24 Oct 2011 16:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9823 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: moreinfo To: francky.leyn@telenet.be Cc: Francky Leyn , 9823@debbugs.gnu.org Received: via spool by 9823-submit@debbugs.gnu.org id=B9823.131947303912898 (code B ref 9823); Mon, 24 Oct 2011 16:18:02 +0000 Received: (at 9823) by debbugs.gnu.org; 24 Oct 2011 16:17:19 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RINDC-0003Ly-4z for submit@debbugs.gnu.org; Mon, 24 Oct 2011 12:17:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RIND7-0003Lh-Ax for 9823@debbugs.gnu.org; Mon, 24 Oct 2011 12:17:16 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9OGFZiQ021260 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 24 Oct 2011 12:15:35 -0400 Received: from [10.3.113.133] (ovpn-113-133.phx2.redhat.com [10.3.113.133]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9OGFYXh004337; Mon, 24 Oct 2011 12:15:34 -0400 Message-ID: <4EA58F26.1060501@redhat.com> Date: Mon, 24 Oct 2011 10:15:34 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Fedora/3.1.15-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.4 Thunderbird/3.1.15 MIME-Version: 1.0 References: <202191489.11824821319443614735.JavaMail.root@thulani.telenet-ops.be> In-Reply-To: <202191489.11824821319443614735.JavaMail.root@thulani.telenet-ops.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-Spam-Score: -10.3 (----------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.3 (----------) [re-adding the list] On 10/24/2011 02:06 AM, francky.leyn@telenet.be wrote: > Hello Eric, > > This is a sequence which reproduces my situation. > >> rm -rf ? >> mkdir -p a b/a >> touch b/a/file1 a/file2 >> mv a b > mv: cannot move `a' to `b/a': Directory not empty Thanks for your formula. In fact, you don't even have to touch a/file2; simply touching b/a/file1 is enough to reproduce the setup (and even makes it more confusing, as then ./a is empty). The problem is that the recursion ends up trying to move the directory ./a (empty or otherwise) from the source, and rename(2) it onto the existing directory ./b/a/ on the destination; but rename(2) can only succeed if the destination directory is empty. > > Ok, in this example it's very clear. > However in my situation it was power play with an account of 120GiB. > When mv says "Directory not empty" you interpret the error message > as that of rmdir, and you go looking at dir a, which of course isn't > empty. It's not immediatly apparent that you have to go looking > after the dir b/a. > > This is the problem I want to address. Would it not be possible > to add to the error image the following message: "Dir b/a already > exists" or something similar making the real problem clear right > from the start? Like I said earlier, POSIX allows either ENOTEMPTY or EEXIST, and Linux happened to choose ENOTEMPTY. Maybe special-casing that error and converting to EEXIST would produce better output. But someone would have to submit a patch. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org From unknown Sat Sep 13 23:19:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9823: request for more correct error reporting of mv Resent-From: Eric Blake Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 24 Oct 2011 17:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9823 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: moreinfo To: francky.leyn@telenet.be Cc: Francky Leyn , 9823@debbugs.gnu.org Received: via spool by 9823-submit@debbugs.gnu.org id=B9823.131947872924406 (code B ref 9823); Mon, 24 Oct 2011 17:53:01 +0000 Received: (at 9823) by debbugs.gnu.org; 24 Oct 2011 17:52:09 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RIOgz-0006Lb-E3 for submit@debbugs.gnu.org; Mon, 24 Oct 2011 13:52:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RIOgv-0006L6-N8 for 9823@debbugs.gnu.org; Mon, 24 Oct 2011 13:52:07 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9OHoRxT010304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 24 Oct 2011 13:50:28 -0400 Received: from [10.3.113.133] (ovpn-113-133.phx2.redhat.com [10.3.113.133]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9OHoQD5010677; Mon, 24 Oct 2011 13:50:27 -0400 Message-ID: <4EA5A562.8090808@redhat.com> Date: Mon, 24 Oct 2011 11:50:26 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Fedora/3.1.15-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.4 Thunderbird/3.1.15 MIME-Version: 1.0 References: <1166195337.11963341319474868392.JavaMail.root@thulani.telenet-ops.be> In-Reply-To: <1166195337.11963341319474868392.JavaMail.root@thulani.telenet-ops.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -10.3 (----------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.3 (----------) [once again, adding the list, so your reply isn't lost] On 10/24/2011 10:47 AM, francky.leyn@telenet.be wrote: >>> This is the problem I want to address. Would it not be possible >>> to add to the error image the following message: "Dir b/a already >>> exists" or something similar making the real problem clear right >>> from the start? >> >> Like I said earlier, POSIX allows either ENOTEMPTY or EEXIST, and >> Linux >> happened to choose ENOTEMPTY. Maybe special-casing that error and >> converting to EEXIST would produce better output. But someone would >> have to submit a patch. > > Sorry, I can't submit a patch, it's beyond my capabilities. > I have submitted the problem, and consider my job done. > > Thanks for the reply, > > Best regards, > > Francky -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org From unknown Sat Sep 13 23:19:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9823: request for more correct error reporting of mv Resent-From: "Voelker, Bernhard" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 25 Oct 2011 06:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9823 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: moreinfo To: Eric Blake , "francky.leyn@telenet.be" Cc: Francky Leyn , "9823@debbugs.gnu.org" <9823@debbugs.gnu.org> Received: via spool by 9823-submit@debbugs.gnu.org id=B9823.13195248569497 (code B ref 9823); Tue, 25 Oct 2011 06:41:01 +0000 Received: (at 9823) by debbugs.gnu.org; 25 Oct 2011 06:40:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RIagw-0002T6-4S for submit@debbugs.gnu.org; Tue, 25 Oct 2011 02:40:55 -0400 Received: from senmx12-mx.siemens-enterprise.com ([62.134.46.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RIagp-0002Sn-Ht for 9823@debbugs.gnu.org; Tue, 25 Oct 2011 02:40:49 -0400 Received: from MCHP063A.global-ad.net (unknown [172.29.37.61]) by senmx12-mx.siemens-enterprise.com (Server) with ESMTP id CA8B323F041C; Tue, 25 Oct 2011 08:39:05 +0200 (CEST) Received: from MCHP058A.global-ad.net ([172.29.37.55]) by MCHP063A.global-ad.net ([172.29.37.61]) with mapi; Tue, 25 Oct 2011 08:39:05 +0200 From: "Voelker, Bernhard" Date: Tue, 25 Oct 2011 08:39:07 +0200 Thread-Topic: bug#9823: request for more correct error reporting of mv Thread-Index: AcySaE9udrepPQbVS7Cgs6tNFPDw1AAdQ2nw Message-ID: <7856072A9D04C24B82DFE2B1112FE38A0D83CB3225@MCHP058A.global-ad.net> References: <202191489.11824821319443614735.JavaMail.root@thulani.telenet-ops.be> <4EA58F26.1060501@redhat.com> In-Reply-To: <4EA58F26.1060501@redhat.com> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE, en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spam-Score: -3.2 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.2 (---) Eric Blake wrote: > On 10/24/2011 02:06 AM, francky.leyn@telenet.be wrote: > > Hello Eric, > > > > This is a sequence which reproduces my situation. > > > >> rm -rf ? > >> mkdir -p a b/a > >> touch b/a/file1 a/file2 > >> mv a b > > mv: cannot move `a' to `b/a': Directory not empty >=20 > Thanks for your formula. In fact, you don't even have to touch a/file2;= =20 > simply touching b/a/file1 is enough to reproduce the setup (and even=20 > makes it more confusing, as then ./a is empty). The problem is that the= =20 > recursion ends up trying to move the directory ./a (empty or otherwise)=20 > from the source, and rename(2) it onto the existing directory ./b/a/ on=20 > the destination; but rename(2) can only succeed if the destination=20 > directory is empty. > > > > Ok, in this example it's very clear. > > However in my situation it was power play with an account of 120GiB. > > When mv says "Directory not empty" you interpret the error message > > as that of rmdir, and you go looking at dir a, which of course isn't > > empty. It's not immediatly apparent that you have to go looking > > after the dir b/a. > > > > This is the problem I want to address. Would it not be possible > > to add to the error image the following message: "Dir b/a already > > exists" or something similar making the real problem clear right > > from the start? >=20 > Like I said earlier, POSIX allows either ENOTEMPTY or EEXIST, and Linux=20 > happened to choose ENOTEMPTY. Maybe special-casing that error and=20 > converting to EEXIST would produce better output. But someone would=20 > have to submit a patch. I think mv is right to say "Directory not empty". Let's look at the opposite example, i.e. where the destination _is_ empty: rm -rf a b mkdir -p a b/a strace -e trace=3Dfile ../src/mv a b ... stat("b", {st_mode=3DS_IFDIR|0750, st_size=3D4096, ...}) =3D 0 lstat("a", {st_mode=3DS_IFDIR|0750, st_size=3D4096, ...}) =3D 0 lstat("b/a", {st_mode=3DS_IFDIR|0750, st_size=3D4096, ...}) =3D 0 access("b/a", W_OK) =3D 0 rename("a", "b/a") =3D 0 The kernel returns success. Have a nice day, Berny= From unknown Sat Sep 13 23:19:33 2025 X-Loop: help-debbugs@gnu.org Subject: bug#9823: request for more correct error reporting of mv Resent-From: Assaf Gordon Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 23 Oct 2018 03:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9823 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: moreinfo To: "9823@debbugs.gnu.org" <9823@debbugs.gnu.org> Received: via spool by 9823-submit@debbugs.gnu.org id=B9823.15402645631611 (code B ref 9823); Tue, 23 Oct 2018 03:17:01 +0000 Received: (at 9823) by debbugs.gnu.org; 23 Oct 2018 03:16:03 +0000 Received: from localhost ([127.0.0.1]:36923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gEnAo-0000Pd-Lm for submit@debbugs.gnu.org; Mon, 22 Oct 2018 23:16:03 -0400 Received: from mail-pf1-f176.google.com ([209.85.210.176]:45871) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gEnAn-0000M1-9R; Mon, 22 Oct 2018 23:16:01 -0400 Received: by mail-pf1-f176.google.com with SMTP id u12-v6so20907162pfn.12; Mon, 22 Oct 2018 20:16:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=UW2fzRftC/89C48PES00A2smXws2j/ZYyd7mwl+Ravk=; b=sTESoBaPsr2I7G9XtC3nSxKDCb8CMq4jbJiRiE5mRQ8zskVkzgqJkcCKxKMv8sFZIp Af3Q8UydzhYgnWXBZVyoT/42nyGS0m2WdWFgIcgNOYh0RFVxGpVnnFR+2zghjM6YM7Yb Wuxj8xWVEBLJnNfkiTzijmGhj1n/oiSdDDYCOI/wpWzgewuPR15v6U8dZRU5h2rBEwUq 22IKVTmxkaHk4I576blzylIH6CazEWL5ABgJa/pXsmAPW8aXscw8DSdv/JxEFH32cSZ/ rE1SuLpuVr86pyY8jcmGSHmCQ5PV9G8/7+OUVaOOI1ICJauhVMSldlAMRjKF3yuwP15U Jf5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UW2fzRftC/89C48PES00A2smXws2j/ZYyd7mwl+Ravk=; b=Pk3kC0VYPsap4rkvhrnMTmBjI495ABCrNtYOR00r1mrRJrOzjb9K1kDtoQZnqdi+C+ 3vyxrmpEyxf7VJWiOnz27gIVceYU1VXY1Q+iLWVr1L65lIEzOK4ASEsPUZdPe6zj1/l2 3BenMnQ0tGGB7W5Bt6e1QZ+bOpJSULVvVr+EMpLRyX3HlBTdadNu2YKDt4/aJaeiiQjL 2MOfufWMmSuDWem6iFuSCzgvsV4VWRAR7EkYTxtUZP0qNEc7NQXcsvk/HzYNIAOhi4A0 XE+sjECaIZOUZSa2G2sVanfl6JjyWteB2WIxhnPeLU0wwPElzpxQEGXnpLr4bBrL9H0V OWGg== X-Gm-Message-State: ABuFfohzOjAgbN+axa5w7wHlsFH87VbhuNDfU2P0hhFfKv0METAShlSN 1VZirsJDhCwNZq+D0eW5u3IyC095OBg= X-Google-Smtp-Source: ACcGV60dTb0qT7bVAmJXoMV69Mn7VwYvk+FA0kFwsgda4qijLFknyFfsCclbORzR/+FxqunerOrdXA== X-Received: by 2002:a63:4045:: with SMTP id n66-v6mr22605576pga.244.1540264554903; Mon, 22 Oct 2018 20:15:54 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id q127-v6sm67068389pgq.19.2018.10.22.20.15.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 20:15:53 -0700 (PDT) References: <202191489.11824821319443614735.JavaMail.root@thulani.telenet-ops.be> <4EA58F26.1060501@redhat.com> <7856072A9D04C24B82DFE2B1112FE38A0D83CB3225@MCHP058A.global-ad.net> From: Assaf Gordon Message-ID: Date: Mon, 22 Oct 2018 21:15:52 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <7856072A9D04C24B82DFE2B1112FE38A0D83CB3225@MCHP058A.global-ad.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 9823 stop (triaging old bugs) On 25/10/11 12:39 AM, Voelker, Bernhard wrote: > Eric Blake wrote: >> Like I said earlier, POSIX allows either ENOTEMPTY or EEXIST, and Linux >> happened to choose ENOTEMPTY. Maybe special-casing that error and >> converting to EEXIST would produce better output. But someone would >> have to submit a patch. > > I think mv is right to say "Directory not empty". Let's look at > the opposite example, i.e. where the destination _is_ empty: Given the above, and no further comments in 7 years, I'm closing this bug. -assaf