From unknown Sun Jun 22 07:53:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64785: Package: coreutils Version: 8.32-4+b1 program=mv Resent-From: Nir Oren Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Sat, 22 Jul 2023 07:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64785 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 64785@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.169001244913676 (code B ref -1); Sat, 22 Jul 2023 07:55:02 +0000 Received: (at submit) by debbugs.gnu.org; 22 Jul 2023 07:54:09 +0000 Received: from localhost ([127.0.0.1]:35404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qN7RI-0003YV-DO for submit@debbugs.gnu.org; Sat, 22 Jul 2023 03:54:08 -0400 Received: from lists.gnu.org ([2001:470:142::17]:57448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMtkw-0008F7-BK for submit@debbugs.gnu.org; Fri, 21 Jul 2023 13:17:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMtkq-0004pI-Fk for bug-coreutils@gnu.org; Fri, 21 Jul 2023 13:17:24 -0400 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qMtko-0004jR-Er for bug-coreutils@gnu.org; Fri, 21 Jul 2023 13:17:24 -0400 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-1ba4460f0a4so1676382fac.0 for ; Fri, 21 Jul 2023 10:17:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=edev-co.20221208.gappssmtp.com; s=20221208; t=1689959840; x=1690564640; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Pdcl3IyChS8AMbAb+kD05Xm/quTlovO17F3yMw9wG9M=; b=kjSqttAqlGb/RWKKHa6A+ks32z+FhodC5J74z0Pp6JvUgQgkZFJ3JMes5MWbITpqnN seL+qo4j2oFAoFer3RkbwheZhM0KF8pgFGmTM48TkVuux30NJ8taSO0lVkX8CAros6rU MpBi3CzyCS0O5F9Fw+0Sqf2mIe4mw07ss/k35hP7yw7qDKTxRJcFxftlW8dPezZ6ZTyA 5F5isNHPcNzCcU7W+vJb/ZMqm/lrOp8ushbysMw9vj8HHyxYHBmtCgfoDKC65EYMVAhw LI9cdeCA8aL7kfno+Ra5J76X5OOXPL0hpa55+nQt5xQUy1HzhRXqbuUkDrDljQFr9XDy ebvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689959840; x=1690564640; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Pdcl3IyChS8AMbAb+kD05Xm/quTlovO17F3yMw9wG9M=; b=LYL6GzkDsOz0YWPBTDnF6sAleolybrvC+xJoAPjLS8exBaR2l3XABxWJKoZYuRf/Ou aKHWQDpY4/shyywqVFvYyeBxTX23IzEXh6S+5WkHblYh6gSkDS1AkwCIN9lTMURhM1Mz zWDWmgInBDLgQNHlzjKtWvnfYG6UcRnsePieWppVy1WRkFHy7XCzFynqLknjckxQCDI3 R8LnwbdFdsYhGEjzK/bhrWBiJwpN3dimrU51g8CrhN2gAslnS5PIFHmF2/zjXLHaXBkn ydO24DHaW6l7gruvV9m+sZ+0ITUZQWVxH7r3QeMKdbZb0dGBF0Opygt2UdKNaW04RUMr JXBA== X-Gm-Message-State: ABy/qLa9GEH/ODWYniGOkAE+jqYAg17olS1TLWKPvz0fmhLfinFatagd U+n97B/cQJS1dXsiW/dIETG5gzARn8oI54shb9QIWY+8evrcq/oIGcgIzg== X-Google-Smtp-Source: APBJJlGJUXgBGeo3gY5I0Enp0oDs5v7CjNJdIdCmIJb/eLW8pv01I4xXnDXCMiZ7RekJ5W+ju+LgBeXpeU4sZ5UGLX0= X-Received: by 2002:a05:6870:b250:b0:1b3:cb26:de97 with SMTP id b16-20020a056870b25000b001b3cb26de97mr2780499oam.13.1689959840587; Fri, 21 Jul 2023 10:17:20 -0700 (PDT) MIME-Version: 1.0 From: Nir Oren Date: Fri, 21 Jul 2023 20:17:00 +0300 Message-ID: Content-Type: multipart/alternative; boundary="000000000000fbb5c80601026f85" Received-SPF: pass client-ip=2001:4860:4864:20::2a; envelope-from=niro@edev.co; helo=mail-oa1-x2a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_FONT_FACE_BAD=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Mailman-Approved-At: Sat, 22 Jul 2023 03:54:07 -0400 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: -0.0 (/) --000000000000fbb5c80601026f85 Content-Type: text/plain; charset="UTF-8" *mv: error message "Directory not empty" is confusing * description: when you try to move a directory to a location already containing a directory with the same name it would just write "mv: cannot move 'A' to 'B': Directory not empty" first, this is technically a wrong error message because there is no requirement that the destination would be empty. the destination might as well be populated with some content, we just require that it would not contain a directory with the same name. second, the error message is confusing because it doesn't state that the problem is with the destination. One can think that the problem is actually with the source, and that the source directory has some kind of attribute that would require it to be empty prior to moving. I would suggest to change the error message to: "*a directory with the same name already exists at destination*" reproduction: $:rm -rf /tmp/node_modules $:mkdir -p proj1/node_modules $:touch proj1/node_modules/foo $:mkdir -p proj2/node_modules $:touch proj2/node_modules/bar $:mv proj1/node_modules /tmp $:mv proj2/node_modules /tmp mv: cannot move 'proj2/node_modules' to '/tmp/node_modules': Directory not empty --000000000000fbb5c80601026f85 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
mv: error message "Directory not empty" is co= nfusing

description:=C2=A0when you try to move a d= irectory to a location already containing a directory with the same name it= would just write "mv: cannot move 'A' to 'B':= =C2=A0Directory not empty"

first,= this is technically a wrong error message because there is no requirement = that the destination would be empty.
the destin= ation might as well be populated with some content, we just require that it= would not contain a directory with the same name.

second, the error message is confusing because it doesn't stat= e that the problem is with the destination. One can think that the problem = is actually with the source, and that the source directory has some kind of= attribute that would require it to be empty prior to moving.
<= div>
I would suggest to change the error message to: &= quot;a directory with the same name already exists at destination&qu= ot;

reprod= uction:
$:rm -rf /tmp/node_modules
$:mkdir -p proj1/node_modules
$:to= uch proj1/node_modules/foo
$:mkdir -p proj2/nod= e_modules
$:touch proj2/node_modules/bar=
$:mv proj1/node_modules /tmp
$:mv proj2/node_modules /tmp
mv: cannot mov= e 'proj2/node_modules' to '/tmp/node_modules': Directory no= t empty
--000000000000fbb5c80601026f85-- From unknown Sun Jun 22 07:53:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64785: Package: coreutils Version: 8.32-4+b1 program=mv Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Sat, 22 Jul 2023 10:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64785 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Nir Oren , 64785@debbugs.gnu.org Received: via spool by 64785-submit@debbugs.gnu.org id=B64785.169002118428244 (code B ref 64785); Sat, 22 Jul 2023 10:20:01 +0000 Received: (at 64785) by debbugs.gnu.org; 22 Jul 2023 10:19:44 +0000 Received: from localhost ([127.0.0.1]:35502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qN9iB-0007LS-M9 for submit@debbugs.gnu.org; Sat, 22 Jul 2023 06:19:43 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:60566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qN9i9-0007LG-JU for 64785@debbugs.gnu.org; Sat, 22 Jul 2023 06:19:42 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3fb4146e8deso25353635e9.0 for <64785@debbugs.gnu.org>; Sat, 22 Jul 2023 03:19:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690021176; x=1690625976; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=rsnJaCICwP9ZcXSDiZPOg/Cu/4CrzdAKXJPp/18PrzQ=; b=NsuDeb3TyT0qrEhYLm19Cfiwq3YuopqbSs+p95hjcQ0oHEJtLY8ybYhlHFJw5b3IDO ffOy/C+QRkZ98e+VqF4KojtRUKzSbA03akQB5hnoXHOCwOckjktyaOuhARVT2vAe6KpP xv6Cx3Qx0m/YIJFJ6XLBkILtd6G2ec/EQrIxPLDGLIEdggzeQwTddNHIozKEiM7GR9W0 rdZtDw5a6AOCvx5/tqlXMvIXzYksJSGy488uSbOanMZ7VNXKOkZ6M7IPaabvAItgv3Tb dfshsEPQ/Qiv6e/03mjdOX2Cu1JQBO/A2bPy5zoxpmUjIw0Kwq/di/gqRJfQVM70nd9c DGvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690021176; x=1690625976; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rsnJaCICwP9ZcXSDiZPOg/Cu/4CrzdAKXJPp/18PrzQ=; b=Vfjn+IFurzbNERXfz1C9eb/YTT9m8DTFBFf7zVpUkraXdJ3gBhcoGsMo2m/PCQLM5a ZvuuR2g1ww343dZdUIesRe0icSCXkmPozA8Q+DxMgxxxV+CDq1Ia16tiCtIjCjqFvbqO RCTGQTC2ZcN+JNpTnthvzH8pvhwRxb5bbhMlFwM3qtTSzsxog4JwXhV592/MMjXFMOF2 yk8QDgTs4DZ0ZIneWZ8hvaeaD3pnIFqqHB0wsFjoa7WXhVa6x0JAu1XmCCLwIasL8TIg kva71RLTQmgn/c0bmVTPLqRe+r15lgjbAGth40NmLg4zC7Rg2yZmX5nl4NTvkbWm86UF M/LQ== X-Gm-Message-State: ABy/qLaYmCsmeCnG/ufTWYAxdl90qfOtkXnSTTknFHDO0OT5Uwh1Vus1 CBXjDnVpaQhhoyBQd4YfGUU= X-Google-Smtp-Source: APBJJlH0rkUUBw2SftbHK9f4vxL+57q2TepfsvXA5YHMsaNNppJnrl7q27jkWUVvXyZ5acI2LvYifQ== X-Received: by 2002:a05:600c:210d:b0:3fa:7b44:7195 with SMTP id u13-20020a05600c210d00b003fa7b447195mr3302724wml.10.1690021175371; Sat, 22 Jul 2023 03:19:35 -0700 (PDT) Received: from [192.168.1.20] (95-44-90-175-dynamic.agg2.lod.rsl-rtd.eircom.net. [95.44.90.175]) by smtp.googlemail.com with ESMTPSA id c16-20020a7bc010000000b003fbe36a4ce6sm7905701wmb.10.2023.07.22.03.19.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 22 Jul 2023 03:19:34 -0700 (PDT) Message-ID: Date: Sat, 22 Jul 2023 11:19:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US References: From: =?UTF-8?Q?P=C3=A1draig?= Brady In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) On 21/07/2023 18:17, Nir Oren wrote: > *mv: error message "Directory not empty" is confusing * > > description: when you try to move a directory to a location already > containing a directory with the same name it would just write "mv: cannot > move 'A' to 'B': Directory not empty" > > first, this is technically a wrong error message because there is no > requirement that the destination would be empty. > the destination might as well be populated with some content, we just > require that it would not contain a directory with the same name. Well that's not exactly the case. mv will replace empty dirs in the destination, so it is significant if the dir in the destination is empty or not. > second, the error message is confusing because it doesn't state that the > problem is with the destination. One can think that the problem is actually > with the source, and that the source directory has some kind of attribute > that would require it to be empty prior to moving. I think it's unlikely that users would be confused as to whether the source needs to be empty. > I would suggest to change the error message to: "*a directory with the same > name already exists at destination*" More accurately the error would be: "a populated directory with the same name already exists" Now would could argue that the above info is implicit in: "directory not empty" (which BTW is just the standard error from ENOTEMPTY). Given the subtleties in this area, I'd be reluctant to adjust diagnostics here. thanks, Pádraig From unknown Sun Jun 22 07:53:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64785: Package: coreutils Version: 8.32-4+b1 program=mv Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Sat, 22 Jul 2023 17:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64785 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: =?UTF-8?Q?P=C3=A1draig?= Brady , Nir Oren Cc: 64785@debbugs.gnu.org Received: via spool by 64785-submit@debbugs.gnu.org id=B64785.169004746719416 (code B ref 64785); Sat, 22 Jul 2023 17:38:02 +0000 Received: (at 64785) by debbugs.gnu.org; 22 Jul 2023 17:37:47 +0000 Received: from localhost ([127.0.0.1]:37539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNGY7-000536-0d for submit@debbugs.gnu.org; Sat, 22 Jul 2023 13:37:47 -0400 Received: from mail.cs.ucla.edu ([131.179.128.66]:41774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNGY4-00052q-3M for 64785@debbugs.gnu.org; Sat, 22 Jul 2023 13:37:45 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id A00913C011BD6; Sat, 22 Jul 2023 10:37:37 -0700 (PDT) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id DOGhkGp2wpI2; Sat, 22 Jul 2023 10:37:37 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 59D223C011BDB; Sat, 22 Jul 2023 10:37:37 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 59D223C011BDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1690047457; bh=6QrM491dzXq47w5QA2XUX1H1TUBLQlNJz+/M6OI/IJI=; h=Message-ID:Date:MIME-Version:To:From; b=R2tSQJI7tKEBopO/0MyFWt7hXFs/2Tcq30mr0HRbhw1KJp2ZG5Hm4qvjkqxP1a7QO ANBE3yYeg6jGlb+zZLXc4tfntZvKmShOXoqPHhmjGfzKnOQqNpC5vEdSnNmzs/HTEt qRTs5ntaWc+WYed+ScLIpvEy00mT7UZzH28JWgMumQTfGyouU8h/JSulo4tNj6w0N6 1VIVMlqOSv41H/IRZhf7n2ab6q6Qz15OpKPwg4rnxbOtaYvqdKhsXs6KI43hEVyd7r Gi5l0bLTgRPYv/OPM/JqhraxOwn0w59xdjzahnxmCx5e8aTndipv2KUHhAmh+XfM2o uKBEqoD+BTWKg== X-Virus-Scanned: amavisd-new at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 4sx6olW9RcxY; Sat, 22 Jul 2023 10:37:37 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 3612D3C011BD6; Sat, 22 Jul 2023 10:37:37 -0700 (PDT) Message-ID: <42edde43-dd17-b47c-f376-a2505ceddf7d@cs.ucla.edu> Date: Sat, 22 Jul 2023 10:37:36 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US References: From: Paul Eggert Organization: UCLA Computer Science Department In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.1 (/) 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.1 (-) On 2023-07-22 03:19, P=C3=A1draig Brady wrote: > Given the subtleties in this area, > I'd be reluctant to adjust diagnostics here. I looked into this a bit more. Given "mv dir e" where e/dir is an=20 existing nonempty directory, 7th Edition Unix fails this way: mv: e/dir exists Solaris 10 mv fails this way: mv: cannot rename dir to e/dir: File exists Coreutils 5.93 fails this way: mv: cannot overwrite directory `e/dir' Current coreutils fails this way: mv: cannot move 'dir' to 'e/dir': Directory not empty macOS fails this way: mv: rename dir to e/dir: Directory not empty If you ask me, none of these are all that good. Current coreutils and=20 macOS give a confusing "Directory not empty" message (which directory?).=20 Solaris 10 has a similar confusion. 7th Edition and coreutils 5.93 don't=20 print strerror (errno). All things considered, how about if we go back to something like=20 coreutils 5.93, except output strerror (errno) too? That is, something=20 like this: mv: cannot overwrite 'e/dir': Directory not empty This focuses the user on the problem, avoiding confusion from the=20 irrelevant source file name. We'd use this format if renameat fails with=20 an errno that means the problem must be with the destination, and stick=20 with the current format otherwise. Affected errno values would be=20 EDQUOT, EISDIR, ENOSPC, EEXIST, ENOTEMPTY. From unknown Sun Jun 22 07:53:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64785: Package: coreutils Version: 8.32-4+b1 program=mv Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Sat, 22 Jul 2023 18:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64785 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Paul Eggert , Nir Oren Cc: 64785@debbugs.gnu.org Received: via spool by 64785-submit@debbugs.gnu.org id=B64785.169005033624092 (code B ref 64785); Sat, 22 Jul 2023 18:26:01 +0000 Received: (at 64785) by debbugs.gnu.org; 22 Jul 2023 18:25:36 +0000 Received: from localhost ([127.0.0.1]:37559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNHIN-0006GW-Nk for submit@debbugs.gnu.org; Sat, 22 Jul 2023 14:25:36 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:48432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNHIL-0006GI-Mi for 64785@debbugs.gnu.org; Sat, 22 Jul 2023 14:25:34 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fbc0609cd6so23720155e9.1 for <64785@debbugs.gnu.org>; Sat, 22 Jul 2023 11:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690050328; x=1690655128; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=cKbwMN5w+amEJABOuxcR7/UyAcXQf+F2TAbsfx2QJhw=; b=Rdd6nSLq4EWD7iaprohK3ri9VSOO2yVrxD7OhUUhu2bYv86W/JJjjimfOeuhTSewwT l5KjYD3acmTDYNjKhG7YZ71MUo9V7tgvgF+ZEZNRvIuyQ7lxAqWJ0o4g5kZTXuxs/KU8 Rh8k/KoUFdJQ8D/7YHHRu4XFtKS6lpSMCJzIA3+gEhYeaD7r0lLLyldeXAdW5VNXGWS7 uXF4suUo+CH6UQ9AtOGokRM66M7vcj8AX1UgZhNqvgJlNN2MbYkEF89rQdD3vD6x7eG4 QaYKHLlf5wbxHtC7T+SxTwKs19FOJ3oxGNyCefsfnTJiyzOIVtiYgoHkLvASVuccNX3R MLNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690050328; x=1690655128; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cKbwMN5w+amEJABOuxcR7/UyAcXQf+F2TAbsfx2QJhw=; b=Kml+RVB/ZYO4/+a8nWJdbeWysSCojvsTzQGAb7qq29LUIPB5Nj//cpjLYN1Kx4YLha JvWeFeahsTfqjcm70ABLJOu/OxiMM7Zu4OY8klsSTFepDN8AkHPl0bk2hxFtLqnRNN3b vCredA9KTTD0vF00f/6YzJKQrgD3czRVWB74z7yQBiWecwUAifg/KYRrElVbnWWUhJOe OeNLEEsRTJKch7f6ZcD4sqCiuisUuIfGaxBhvQXGv97Q9EMWebUJKQYEKifoCFzAg8y7 p7bvR/4vFnP4DUPhV8TWe7fell/NkXjgcuFL5yhMc5BLeesnyULsQBH56YRYVKBEkGo/ baWg== X-Gm-Message-State: ABy/qLbx4N3tu3Cqw8Tw+LIzJbtmhD5k1B+GWAup2WwFx8hfzh5Z4V0v XLqFN8/tfetMqsmAZHU2DQY= X-Google-Smtp-Source: APBJJlFGtxeMwb67Vgk2YDltIrYAgK0vhTvN172F5725Ei+ogPsxiyI62I66Po+4iJDSR7THJmXVyw== X-Received: by 2002:a05:6000:1b90:b0:306:46c4:d313 with SMTP id r16-20020a0560001b9000b0030646c4d313mr2935441wru.28.1690050327533; Sat, 22 Jul 2023 11:25:27 -0700 (PDT) Received: from [192.168.1.20] (95-44-90-175-dynamic.agg2.lod.rsl-rtd.eircom.net. [95.44.90.175]) by smtp.googlemail.com with ESMTPSA id bh17-20020a05600c3d1100b003fbb1ce274fsm22930270wmb.0.2023.07.22.11.25.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 22 Jul 2023 11:25:27 -0700 (PDT) Message-ID: <0d08f90b-ea2d-f9cd-1bc2-d1da4f1ba0da@draigBrady.com> Date: Sat, 22 Jul 2023 19:25:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US References: <42edde43-dd17-b47c-f376-a2505ceddf7d@cs.ucla.edu> From: =?UTF-8?Q?P=C3=A1draig?= Brady In-Reply-To: <42edde43-dd17-b47c-f376-a2505ceddf7d@cs.ucla.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) 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: -0.5 (/) On 22/07/2023 18:37, Paul Eggert wrote: > On 2023-07-22 03:19, Pádraig Brady wrote: >> Given the subtleties in this area, >> I'd be reluctant to adjust diagnostics here. > > I looked into this a bit more. Given "mv dir e" where e/dir is an > existing nonempty directory, 7th Edition Unix fails this way: > > mv: e/dir exists > > Solaris 10 mv fails this way: > > mv: cannot rename dir to e/dir: File exists > > Coreutils 5.93 fails this way: > > mv: cannot overwrite directory `e/dir' > > Current coreutils fails this way: > > mv: cannot move 'dir' to 'e/dir': Directory not empty > > macOS fails this way: > > mv: rename dir to e/dir: Directory not empty > > If you ask me, none of these are all that good. Current coreutils and > macOS give a confusing "Directory not empty" message (which directory?). > Solaris 10 has a similar confusion. 7th Edition and coreutils 5.93 don't > print strerror (errno). > > All things considered, how about if we go back to something like > coreutils 5.93, except output strerror (errno) too? That is, something > like this: > > mv: cannot overwrite 'e/dir': Directory not empty > > This focuses the user on the problem, avoiding confusion from the > irrelevant source file name. We'd use this format if renameat fails with > an errno that means the problem must be with the destination, and stick > with the current format otherwise. Affected errno values would be > EDQUOT, EISDIR, ENOSPC, EEXIST, ENOTEMPTY. Sounds good. Thanks for looking into all the details. Padraig From unknown Sun Jun 22 07:53:23 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Nir Oren Subject: bug#64785: closed (Re: bug#64785: Package: coreutils Version: 8.32-4+b1 program=mv) Message-ID: References: <0b3fab88-372f-a3fa-64d1-8c85b58959c3@cs.ucla.edu> X-Gnu-PR-Message: they-closed 64785 X-Gnu-PR-Package: coreutils Reply-To: 64785@debbugs.gnu.org Date: Sat, 22 Jul 2023 20:48:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1690058882-6875-1" This is a multi-part message in MIME format... ------------=_1690058882-6875-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #64785: Package: coreutils Version: 8.32-4+b1 program=3Dmv which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 64785@debbugs.gnu.org. --=20 64785: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D64785 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1690058882-6875-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 64785-done) by debbugs.gnu.org; 22 Jul 2023 20:48:01 +0000 Received: from localhost ([127.0.0.1]:37616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNJWC-0001mV-7k for submit@debbugs.gnu.org; Sat, 22 Jul 2023 16:48:00 -0400 Received: from mail.cs.ucla.edu ([131.179.128.66]:38962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNJW8-0001lO-OI for 64785-done@debbugs.gnu.org; Sat, 22 Jul 2023 16:47:59 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 3ECB43C011BD6; Sat, 22 Jul 2023 13:47:50 -0700 (PDT) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 4hnYXWO3Qhou; Sat, 22 Jul 2023 13:47:49 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 8A1E03C011BDB; Sat, 22 Jul 2023 13:47:49 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu 8A1E03C011BDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1690058869; bh=az0j7BVJc9KYTgGZDreATjC4Roj3iPyoAS5s7A7ETQc=; h=Message-ID:Date:MIME-Version:To:From; b=d5M8abmYWWSCppGuU0YYmzdzksjaeI6/JYa1TuRs2zqFe60+JHPZ3dwG4ELKX29QB X9R3D/2wTfHI1V3r8bj9SM7ggDrpmX+Im0zJuQUBQeV0AijHBTVqNEvtxxME89q0HV jR89gc45soiM6/THMVXB/nuIvbcgSR7YDoc3UTfGndHutX0rkZC95wdGwsQTdlE9pq lLFiXc2ozIujrE3rbC+uM+mx431Jj7wbIRAp3xgH/t7CJHLIkkOvVergHTDtQriVzm sqsDXMpnDGI7JSn9Dr9F+aX1H91JVCGiunbHM7J7Ru1D6Mq8VADzb6BdLTSNADqzJp sjhddGg3OLIaA== X-Virus-Scanned: amavisd-new at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Gu-LIqkLJ9j8; Sat, 22 Jul 2023 13:47:49 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id 5CF733C011BD6; Sat, 22 Jul 2023 13:47:49 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------783XXHAA0q4JANpovfe9d9js" Message-ID: <0b3fab88-372f-a3fa-64d1-8c85b58959c3@cs.ucla.edu> Date: Sat, 22 Jul 2023 13:47:47 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: Nir Oren References: <42edde43-dd17-b47c-f376-a2505ceddf7d@cs.ucla.edu> From: Paul Eggert Organization: UCLA Computer Science Department Subject: Re: bug#64785: Package: coreutils Version: 8.32-4+b1 program=mv In-Reply-To: X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 64785-done Cc: 64785-done@debbugs.gnu.org, =?UTF-8?Q?P=c3=a1draig_Brady?= 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.1 (-) This is a multi-part message in MIME format. --------------783XXHAA0q4JANpovfe9d9js Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Thanks to both of you. I installed the attached into Savannah master coreutils. It implements the suggestion, except that later I noticed that EMLINK and ETXTBSY can join the throng. At some point it might make sense to scan for other direct or indirect calls to renameat, renameat2, and linkat, where the diagnostic could be improved if it's known to refer to the destination. --------------783XXHAA0q4JANpovfe9d9js Content-Type: text/x-patch; charset=UTF-8; name="0001-mv-better-diagnostic-for-mv-dir-x-failure.patch" Content-Disposition: attachment; filename="0001-mv-better-diagnostic-for-mv-dir-x-failure.patch" Content-Transfer-Encoding: base64 RnJvbSAzY2I4NjJjZTVmMTBkYjM5MmNjOGU2OTA3ZGQ5ZDg4OGFjZmEyYTMwIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1 PgpEYXRlOiBTYXQsIDIyIEp1bCAyMDIzIDEzOjM5OjE3IC0wNzAwClN1YmplY3Q6IFtQQVRD SF0gbXY6IGJldHRlciBkaWFnbm9zdGljIGZvciAnbXYgZGlyIHgnIGZhaWx1cmUKClByb2Js ZW0gcmVwb3J0ZWQgYnkgTmlyIE9yZW4gPGh0dHBzOi8vYnVncy5nbnUub3JnLzY0Nzg1Pi4K KiBzcmMvY29weS5jIChjb3B5X2ludGVybmFsKTogVXNlIGEgbW9yZS1zcGVjaWZpYyBkaWFn bm9zdGljIHdoZW4KYSByZW5hbWUgZmFpbHMgZHVlIHRvIGEgcHJvYmxlbSB0aGF0IG11c3Qg YmUgZHVlIHRvIHRoZQpkZXN0aW5hdGlvbiwgYXZvaWRpbmcgdXNlciBjb25mdXNpb24gaW4g Y2FzZXMgbGlrZSAnbXYgZGlyIHgnCndoZXJlIHggaXMgYSBub25lbXB0eSBkaXJlY3Rvcnku CiogdGVzdHMvbXYvZGlyMmRpci5zaDogQWRqdXN0IHRvIG1hdGNoLgotLS0KIE5FV1MgICAg ICAgICAgICAgICAgfCAgNyArKysrKysrCiBzcmMvY29weS5jICAgICAgICAgIHwgMjAgKysr KysrKysrKysrKysrKystLS0KIHRlc3RzL212L2RpcjJkaXIuc2ggfCAgMiArLQogMyBmaWxl cyBjaGFuZ2VkLCAyNSBpbnNlcnRpb25zKCspLCA0IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdp dCBhL05FV1MgYi9ORVdTCmluZGV4IDdkMmNhN2Y2Yi4uYmQwYzU5ZWI1IDEwMDY0NAotLS0g YS9ORVdTCisrKyBiL05FV1MKQEAgLTU2LDYgKzU2LDEzIEBAIEdOVSBjb3JldXRpbHMgTkVX UyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0qLSBvdXRsaW5lIC0qLQog ICBzaG9ydCBvcHRpb24gaXMgcmVzZXJ2ZWQgdG8gYmV0dGVyIHN1cHBvcnQgZW11bGF0aW9u IG9mIHRoZSBzdGFuZGFsb25lCiAgIGNoZWNrc3VtIHV0aWxpdGllcyB3aXRoIGNrc3VtLgog CisgICdtdiBkaXIgeCcgbm93IGNvbXBsYWlucyBkaWZmZXJlbnRseSBpZiB4L2RpciBpcyBh IG5vbmVtcHR5IGRpcmVjdG9yeS4KKyAgUHJldmlvdXNseSBpdCBzYWlkICJtdjogY2Fubm90 IG1vdmUgJ2RpcicgdG8gJ3gvZGlyJzogRGlyZWN0b3J5IG5vdCBlbXB0eSIsCisgIHdoZXJl IGl0IHdhcyB1bmNsZWFyIHdoZXRoZXIgJ2Rpcicgb3IgJ3gvZGlyJyB3YXMgdGhlIHByb2Js ZW0uCisgIE5vdyBpdCBzYXlzICJtdjogY2Fubm90IG92ZXJ3cml0ZSAneC9kaXInOiBEaXJl Y3Rvcnkgbm90IGVtcHR5Ii4KKyAgU2ltaWxhcmx5IGZvciBvdGhlciByZW5hbWVzIHdoZXJl IHRoZSBkZXN0aW5hdGlvbiBtdXN0IGJlIHRoZSBwcm9ibGVtLgorICBbcHJvYmxlbSBpbnRy b2R1Y2VkIGluIGNvcmV1dGlscy02LjBdCisKICoqIEltcHJvdmVtZW50cwogCiAgIGNwLCBt diwgYW5kIGluc3RhbGwgbm93IGF2b2lkIGNvcHlfZmlsZV9yYW5nZSBvbiBsaW51eCBrZXJu ZWxzIGJlZm9yZSA1LjMKZGlmZiAtLWdpdCBhL3NyYy9jb3B5LmMgYi9zcmMvY29weS5jCmlu ZGV4IGRkYzllYWIzMC4uOTBlZWJmNmJjIDEwMDY0NAotLS0gYS9zcmMvY29weS5jCisrKyBi L3NyYy9jb3B5LmMKQEAgLTI4NDAsOSArMjg0MCwyMyBAQCBza2lwOgogICAgICAgICAgICAg IElmIHRoZSBwZXJtaXNzaW9ucyBvbiB0aGUgZGlyZWN0b3J5IGNvbnRhaW5pbmcgdGhlIHNv dXJjZSBvcgogICAgICAgICAgICAgIGRlc3RpbmF0aW9uIGZpbGUgYXJlIG1hZGUgdG9vIHJl c3RyaWN0aXZlLCB0aGUgcmVuYW1lIHdpbGwKICAgICAgICAgICAgICBmYWlsLiAgRXRjLiAg Ki8KLSAgICAgICAgICBlcnJvciAoMCwgcmVuYW1lX2Vycm5vLAotICAgICAgICAgICAgICAg ICBfKCJjYW5ub3QgbW92ZSAlcyB0byAlcyIpLAotICAgICAgICAgICAgICAgICBxdW90ZWFm X24gKDAsIHNyY19uYW1lKSwgcXVvdGVhZl9uICgxLCBkc3RfbmFtZSkpOworICAgICAgICAg IGNoYXIgY29uc3QgKnF1b3RlZF9kc3RfbmFtZSA9IHF1b3RlYWZfbiAoMSwgZHN0X25hbWUp OworICAgICAgICAgIHN3aXRjaCAocmVuYW1lX2Vycm5vKQorICAgICAgICAgICAgeworICAg ICAgICAgICAgY2FzZSBFRFFVT1Q6IGNhc2UgRUVYSVNUOiBjYXNlIEVJU0RJUjogY2FzZSBF TUxJTks6CisgICAgICAgICAgICBjYXNlIEVOT1NQQzogY2FzZSBFTk9URU1QVFk6IGNhc2Ug RVRYVEJTWToKKyAgICAgICAgICAgICAgLyogVGhlIGRlc3RpbmF0aW9uIG11c3QgYmUgdGhl IHByb2JsZW0uICBEb24ndCBtZW50aW9uCisgICAgICAgICAgICAgICAgIHRoZSBzb3VyY2Ug YXMgdGhhdCBpcyBtb3JlIGxpa2VseSB0byBjb25mdXNlIHRoZSB1c2VyCisgICAgICAgICAg ICAgICAgIHRoYW4gYmUgaGVscGZ1bC4gICovCisgICAgICAgICAgICAgIGVycm9yICgwLCBy ZW5hbWVfZXJybm8sIF8oImNhbm5vdCBvdmVyd3JpdGUgJXMiKSwKKyAgICAgICAgICAgICAg ICAgICAgIHF1b3RlZF9kc3RfbmFtZSk7CisgICAgICAgICAgICAgIGJyZWFrOworCisgICAg ICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICBlcnJvciAoMCwgcmVuYW1lX2Vycm5v LCBfKCJjYW5ub3QgbW92ZSAlcyB0byAlcyIpLAorICAgICAgICAgICAgICAgICAgICAgcXVv dGVhZl9uICgwLCBzcmNfbmFtZSksIHF1b3RlZF9kc3RfbmFtZSk7CisgICAgICAgICAgICAg IGJyZWFrOworICAgICAgICAgICAgfQogICAgICAgICAgIGZvcmdldF9jcmVhdGVkIChzcmNf c2Iuc3RfaW5vLCBzcmNfc2Iuc3RfZGV2KTsKICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAg ICAgICAgIH0KZGlmZiAtLWdpdCBhL3Rlc3RzL212L2RpcjJkaXIuc2ggYi90ZXN0cy9tdi9k aXIyZGlyLnNoCmluZGV4IGVhOTllY2E1Ni4uZGE2YTUxOGU1IDEwMDc1NQotLS0gYS90ZXN0 cy9tdi9kaXIyZGlyLnNoCisrKyBiL3Rlc3RzL212L2RpcjJkaXIuc2gKQEAgLTM0LDcgKzM0 LDcgQEAgc2VkICAgICAgICAgICAgICdzLzogRmlsZSBleGlzdHMvOiBEaXJlY3Rvcnkgbm90 IGVtcHR5Lyc8b3V0Pm8xO212IG8xIG91dAogc2VkICdzLzogRGV2aWNlIG9yIHJlc291cmNl IGJ1c3kvOiBEaXJlY3Rvcnkgbm90IGVtcHR5Lyc8b3V0Pm8xO212IG8xIG91dAogCiBjYXQg PDxcRU9GID4gZXhwIHx8IGZyYW1ld29ya19mYWlsdXJlXwotbXY6IGNhbm5vdCBtb3ZlICdi L3QnIHRvICdhL3QnOiBEaXJlY3Rvcnkgbm90IGVtcHR5CittdjogY2Fubm90IG92ZXJ3cml0 ZSAnYS90JzogRGlyZWN0b3J5IG5vdCBlbXB0eQogRU9GCiAKIGNvbXBhcmUgZXhwIG91dCB8 fCBmYWlsPTEKLS0gCjIuMzkuMgoK --------------783XXHAA0q4JANpovfe9d9js-- ------------=_1690058882-6875-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 22 Jul 2023 07:54:09 +0000 Received: from localhost ([127.0.0.1]:35404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qN7RI-0003YV-DO for submit@debbugs.gnu.org; Sat, 22 Jul 2023 03:54:08 -0400 Received: from lists.gnu.org ([2001:470:142::17]:57448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMtkw-0008F7-BK for submit@debbugs.gnu.org; Fri, 21 Jul 2023 13:17:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMtkq-0004pI-Fk for bug-coreutils@gnu.org; Fri, 21 Jul 2023 13:17:24 -0400 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qMtko-0004jR-Er for bug-coreutils@gnu.org; Fri, 21 Jul 2023 13:17:24 -0400 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-1ba4460f0a4so1676382fac.0 for ; Fri, 21 Jul 2023 10:17:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=edev-co.20221208.gappssmtp.com; s=20221208; t=1689959840; x=1690564640; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Pdcl3IyChS8AMbAb+kD05Xm/quTlovO17F3yMw9wG9M=; b=kjSqttAqlGb/RWKKHa6A+ks32z+FhodC5J74z0Pp6JvUgQgkZFJ3JMes5MWbITpqnN seL+qo4j2oFAoFer3RkbwheZhM0KF8pgFGmTM48TkVuux30NJ8taSO0lVkX8CAros6rU MpBi3CzyCS0O5F9Fw+0Sqf2mIe4mw07ss/k35hP7yw7qDKTxRJcFxftlW8dPezZ6ZTyA 5F5isNHPcNzCcU7W+vJb/ZMqm/lrOp8ushbysMw9vj8HHyxYHBmtCgfoDKC65EYMVAhw LI9cdeCA8aL7kfno+Ra5J76X5OOXPL0hpa55+nQt5xQUy1HzhRXqbuUkDrDljQFr9XDy ebvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689959840; x=1690564640; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Pdcl3IyChS8AMbAb+kD05Xm/quTlovO17F3yMw9wG9M=; b=LYL6GzkDsOz0YWPBTDnF6sAleolybrvC+xJoAPjLS8exBaR2l3XABxWJKoZYuRf/Ou aKHWQDpY4/shyywqVFvYyeBxTX23IzEXh6S+5WkHblYh6gSkDS1AkwCIN9lTMURhM1Mz zWDWmgInBDLgQNHlzjKtWvnfYG6UcRnsePieWppVy1WRkFHy7XCzFynqLknjckxQCDI3 R8LnwbdFdsYhGEjzK/bhrWBiJwpN3dimrU51g8CrhN2gAslnS5PIFHmF2/zjXLHaXBkn ydO24DHaW6l7gruvV9m+sZ+0ITUZQWVxH7r3QeMKdbZb0dGBF0Opygt2UdKNaW04RUMr JXBA== X-Gm-Message-State: ABy/qLa9GEH/ODWYniGOkAE+jqYAg17olS1TLWKPvz0fmhLfinFatagd U+n97B/cQJS1dXsiW/dIETG5gzARn8oI54shb9QIWY+8evrcq/oIGcgIzg== X-Google-Smtp-Source: APBJJlGJUXgBGeo3gY5I0Enp0oDs5v7CjNJdIdCmIJb/eLW8pv01I4xXnDXCMiZ7RekJ5W+ju+LgBeXpeU4sZ5UGLX0= X-Received: by 2002:a05:6870:b250:b0:1b3:cb26:de97 with SMTP id b16-20020a056870b25000b001b3cb26de97mr2780499oam.13.1689959840587; Fri, 21 Jul 2023 10:17:20 -0700 (PDT) MIME-Version: 1.0 From: Nir Oren Date: Fri, 21 Jul 2023 20:17:00 +0300 Message-ID: Subject: Package: coreutils Version: 8.32-4+b1 program=mv To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary="000000000000fbb5c80601026f85" Received-SPF: pass client-ip=2001:4860:4864:20::2a; envelope-from=niro@edev.co; helo=mail-oa1-x2a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_FONT_FACE_BAD=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 22 Jul 2023 03:54:07 -0400 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: -0.0 (/) --000000000000fbb5c80601026f85 Content-Type: text/plain; charset="UTF-8" *mv: error message "Directory not empty" is confusing * description: when you try to move a directory to a location already containing a directory with the same name it would just write "mv: cannot move 'A' to 'B': Directory not empty" first, this is technically a wrong error message because there is no requirement that the destination would be empty. the destination might as well be populated with some content, we just require that it would not contain a directory with the same name. second, the error message is confusing because it doesn't state that the problem is with the destination. One can think that the problem is actually with the source, and that the source directory has some kind of attribute that would require it to be empty prior to moving. I would suggest to change the error message to: "*a directory with the same name already exists at destination*" reproduction: $:rm -rf /tmp/node_modules $:mkdir -p proj1/node_modules $:touch proj1/node_modules/foo $:mkdir -p proj2/node_modules $:touch proj2/node_modules/bar $:mv proj1/node_modules /tmp $:mv proj2/node_modules /tmp mv: cannot move 'proj2/node_modules' to '/tmp/node_modules': Directory not empty --000000000000fbb5c80601026f85 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
mv: error message "Directory not empty" is co= nfusing

description:=C2=A0when you try to move a d= irectory to a location already containing a directory with the same name it= would just write "mv: cannot move 'A' to 'B':= =C2=A0Directory not empty"

first,= this is technically a wrong error message because there is no requirement = that the destination would be empty.
the destin= ation might as well be populated with some content, we just require that it= would not contain a directory with the same name.

second, the error message is confusing because it doesn't stat= e that the problem is with the destination. One can think that the problem = is actually with the source, and that the source directory has some kind of= attribute that would require it to be empty prior to moving.
<= div>
I would suggest to change the error message to: &= quot;a directory with the same name already exists at destination&qu= ot;

reprod= uction:
$:rm -rf /tmp/node_modules
$:mkdir -p proj1/node_modules
$:to= uch proj1/node_modules/foo
$:mkdir -p proj2/nod= e_modules
$:touch proj2/node_modules/bar=
$:mv proj1/node_modules /tmp
$:mv proj2/node_modules /tmp
mv: cannot mov= e 'proj2/node_modules' to '/tmp/node_modules': Directory no= t empty
--000000000000fbb5c80601026f85-- ------------=_1690058882-6875-1-- From unknown Sun Jun 22 07:53:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#64785: Package: coreutils Version: 8.32-4+b1 program=mv Resent-From: Nir Oren Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Sun, 23 Jul 2023 04:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64785 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Paul Eggert Cc: =?UTF-8?Q?P=C3=A1draig?= Brady , 64785@debbugs.gnu.org Received: via spool by 64785-submit@debbugs.gnu.org id=B64785.169008557518557 (code B ref 64785); Sun, 23 Jul 2023 04:13:02 +0000 Received: (at 64785) by debbugs.gnu.org; 23 Jul 2023 04:12:55 +0000 Received: from localhost ([127.0.0.1]:37765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNQSk-0004pE-J6 for submit@debbugs.gnu.org; Sun, 23 Jul 2023 00:12:55 -0400 Received: from mail-oo1-xc36.google.com ([2607:f8b0:4864:20::c36]:55566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNIUT-0008O0-F0 for 64785@debbugs.gnu.org; Sat, 22 Jul 2023 15:42:10 -0400 Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-5636ab8240cso1438884eaf.3 for <64785@debbugs.gnu.org>; Sat, 22 Jul 2023 12:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=edev-co.20221208.gappssmtp.com; s=20221208; t=1690054924; x=1690659724; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ilCoMVw+igR27Zfeb1nlGQTq2Io9stKvhZWRrFnp5xE=; b=lWXciS6eRQWPQAQVei5xTgqi2sktnmE3qiQtfmeO04qwvIAIC9Z99zbtADgtbQS6pn mfFrrG9OjNWecvL0ZP0W4u/a7EZi5+S8DhRnEKrCLjz48NFYLcRNA0tt46SCoyasFYcH VzpOBTptwacLKxs4tjwoKbv9TaLlHsWxS6PTSsx0E+0vFas9KFL25bEp8wcB2RX0CPJa 0swyxaZLOcPGDAM3AwxSsABzw/jlWZsAvPqMzhvz/ulhmyWXmSxgQSvsQKXjwbj7impg RzXGgkTqUzudZA3CU2pUm6PeyKdGJDKVbdakd7qa2SwjuUm+za6F0XdtgPFLroK/umNu GW4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690054924; x=1690659724; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ilCoMVw+igR27Zfeb1nlGQTq2Io9stKvhZWRrFnp5xE=; b=RKM9uFeUWHElu2lLWdJInBNhOiCK+75PR2BB2ugHRY49cv832XALfnUwCbXXhoZkbo Coo9bA7Yt0TQJ2iMzlAg/XRE9MVIs6dxgIwfDhYpHUpPEqtxlYx69+FhCCzViPMyc6Vy gMsSaGFuPPKysj9rtT8HB2KamzRvrBI4wB9L5RjNUwkBA7KW3GPGbAfNrMmzC2oNSR6X wxh2WT3pRcQQZcppamDo2etDLp7FYdvsoMWuawZFQHWKVVPmzvLWcc59N8KtCFtA43b1 4M6utwZ+Saf8COcMdZAlrfoo7ro9XP+Eg2yvs/JOFrjrm3S/N1smEsyaegufk/alIQkF M7sw== X-Gm-Message-State: ABy/qLb2ZKn7u+GfO206dK5Cf1+dJTE8Hcwlo+QCh1CwrXlp3ih6hvoo 3GlXX+zypfyDC3LHsvljoFjjVi3mAJtp9Qowr7WGlg== X-Google-Smtp-Source: APBJJlGpzDUHM0mQX0uHj2gDFzxzIoIgxszfd47fEk53As3G+6x3U/d04lph3bZB92LrsidePJbnkM8MfHgxDW/F02Y= X-Received: by 2002:a4a:9192:0:b0:566:fe1c:86e3 with SMTP id d18-20020a4a9192000000b00566fe1c86e3mr3601707ooh.3.1690054923722; Sat, 22 Jul 2023 12:42:03 -0700 (PDT) MIME-Version: 1.0 References: <42edde43-dd17-b47c-f376-a2505ceddf7d@cs.ucla.edu> In-Reply-To: <42edde43-dd17-b47c-f376-a2505ceddf7d@cs.ucla.edu> From: Nir Oren Date: Sat, 22 Jul 2023 22:41:00 +0300 Message-ID: Content-Type: multipart/alternative; boundary="000000000000613a2806011893b1" X-Spam-Score: -0.0 (/) X-Mailman-Approved-At: Sun, 23 Jul 2023 00:12:52 -0400 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 (-) --000000000000613a2806011893b1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I agree with Paul suggestion for an error message. In any case, Coreutils 5.93 message was better than the current one On Sat, Jul 22, 2023 at 8:37=E2=80=AFPM Paul Eggert wr= ote: > On 2023-07-22 03:19, P=C3=A1draig Brady wrote: > > Given the subtleties in this area, > > I'd be reluctant to adjust diagnostics here. > > I looked into this a bit more. Given "mv dir e" where e/dir is an > existing nonempty directory, 7th Edition Unix fails this way: > > mv: e/dir exists > > Solaris 10 mv fails this way: > > mv: cannot rename dir to e/dir: File exists > > Coreutils 5.93 fails this way: > > mv: cannot overwrite directory `e/dir' > > Current coreutils fails this way: > > mv: cannot move 'dir' to 'e/dir': Directory not empty > > macOS fails this way: > > mv: rename dir to e/dir: Directory not empty > > If you ask me, none of these are all that good. Current coreutils and > macOS give a confusing "Directory not empty" message (which directory?). > Solaris 10 has a similar confusion. 7th Edition and coreutils 5.93 don't > print strerror (errno). > > All things considered, how about if we go back to something like > coreutils 5.93, except output strerror (errno) too? That is, something > like this: > > mv: cannot overwrite 'e/dir': Directory not empty > > This focuses the user on the problem, avoiding confusion from the > irrelevant source file name. We'd use this format if renameat fails with > an errno that means the problem must be with the destination, and stick > with the current format otherwise. Affected errno values would be > EDQUOT, EISDIR, ENOSPC, EEXIST, ENOTEMPTY. > --000000000000613a2806011893b1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I agree with Paul suggestion for an error= message.
In any case, Coreutils 5.93 message was better than the curre= nt one

On Sat, Jul 22, 2023 at 8:37=E2=80=AFPM Paul Eggert <eggert@cs.ucla.edu> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">On 2023-07-22 03:19, P=C3= =A1draig Brady wrote:
> Given the subtleties in this area,
> I'd be reluctant to adjust diagnostics here.

I looked into this a bit more. Given "mv dir e" where e/dir is an=
existing nonempty directory, 7th Edition Unix fails this way:

=C2=A0 =C2=A0mv: e/dir exists

Solaris 10 mv fails this way:

=C2=A0 =C2=A0mv: cannot rename dir to e/dir: File exists

Coreutils 5.93 fails this way:

=C2=A0 =C2=A0mv: cannot overwrite directory `e/dir'

Current coreutils fails this way:

=C2=A0 =C2=A0mv: cannot move 'dir' to 'e/dir': Directory no= t empty

macOS fails this way:

=C2=A0 =C2=A0mv: rename dir to e/dir: Directory not empty

If you ask me, none of these are all that good. Current coreutils and
macOS give a confusing "Directory not empty" message (which direc= tory?).
Solaris 10 has a similar confusion. 7th Edition and coreutils 5.93 don'= t
print strerror (errno).

All things considered, how about if we go back to something like
coreutils 5.93, except output strerror (errno) too? That is, something
like this:

=C2=A0 =C2=A0mv: cannot overwrite 'e/dir': Directory not empty

This focuses the user on the problem, avoiding confusion from the
irrelevant source file name. We'd use this format if renameat fails wit= h
an errno that means the problem must be with the destination, and stick with the current format otherwise. Affected errno values would be
EDQUOT, EISDIR, ENOSPC, EEXIST, ENOTEMPTY.
--000000000000613a2806011893b1--