From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gustavo Barros Newsgroups: gmane.emacs.bugs Subject: bug#58721: 28.2; dired with delete-by-moving-to-trash can't trash directory twice Date: Fri, 28 Oct 2022 09:35:45 -0300 Message-ID: References: <83r0ytl042.fsf@gnu.org> <83bkpxkwcd.fsf@gnu.org> <838rl1ku1b.fsf@gnu.org> <837d0lks02.fsf@gnu.org> <83lep0jspb.fsf@gnu.org> <83edusjhpe.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39669"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58721@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 28 14:37:44 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ooOcK-000A85-NA for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Oct 2022 14:37:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooOcE-0006Uy-Q5; Fri, 28 Oct 2022 08:37:39 -0400 Original-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 1ooObf-0005sN-0d for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 08:37:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ooObe-00056Q-Jb for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 08:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ooObe-0006Bl-5M for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 08:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gustavo Barros Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Oct 2022 12:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58721 X-GNU-PR-Package: emacs Original-Received: via spool by 58721-submit@debbugs.gnu.org id=B58721.166696056623721 (code B ref 58721); Fri, 28 Oct 2022 12:37:02 +0000 Original-Received: (at 58721) by debbugs.gnu.org; 28 Oct 2022 12:36:06 +0000 Original-Received: from localhost ([127.0.0.1]:60610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooOaj-0006AX-BD for submit@debbugs.gnu.org; Fri, 28 Oct 2022 08:36:05 -0400 Original-Received: from mail-pg1-f178.google.com ([209.85.215.178]:38455) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooOah-0006A1-7E for 58721@debbugs.gnu.org; Fri, 28 Oct 2022 08:36:03 -0400 Original-Received: by mail-pg1-f178.google.com with SMTP id 20so4719100pgc.5 for <58721@debbugs.gnu.org>; Fri, 28 Oct 2022 05:36:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=US2GSfFC4L9PADTC24I18vJhHy+BZY7f2B6N4gvaZck=; b=O0ZXbnx4GrcJT9DygYsE+iui8WPwB5O1xnBK1ty7QgOVKQQXLD20XExtSL3yOLl46+ TCFqMhqGp2RheeySWUWzDh9Dx6FSsqJJJDSiB+eQssowtkw+V1PnlGxuhazy7JXlL3v/ nnHwpDG22cic2cZSfo5cF0rRu90+Yxjp9tDX+p1vrupoe5rr+YBpzokOZvUiOyMHHFeb ZqmJtYqdGraXsRaF0ABJVOZ6Io55sJ3+ywKs1QHUCBVPOvDGRJknsheA3GvzFShJ4aHU OWHUhfsvt42eqkIKrwb1LJ6g0/LcFktW862QmJbAENnyFSoApt3suVtnEu/G8Ilk9ZsY Gs5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=US2GSfFC4L9PADTC24I18vJhHy+BZY7f2B6N4gvaZck=; b=McvP7orc42f3iNMQPB+FoyiLjHLE4ZWJZ9G3WvEQJXMAJ1SXafUZez/Y1E+ZWLuZdB ZWfbfahCOhPkk/XPAZIk7e9JcAh0bcxEoHjsfUTe/kSCSX7toFM8+Oh8L/zXUk1Xjlfo tJUyzScdta30IzBXgjvvEoFJ7WfGuSrmPi6eTANLvFEoaT3ian880yCyEaNZEQuTCeTt i19QKWo7x2lrTLnKft2RLzpBf0BapQY+cHzH3kqzmUvBH1mVJEV966krpJbtZFpea8XP kkxtLTXvpKDux143JNDD38A6fCpEMQ/CM25IohwzDaJxYOYkCUbmoE21fhiDa4YImrq9 WxNg== X-Gm-Message-State: ACrzQf1tChGWhNcb8bcYSHRoki4+EbUHr/QcvTUaLCAP4dcJB3rEI+77 ix3OkaUShVT6wxRAredkfRqteZoiXHlXwDe8RmYDYzp7May8LA== X-Google-Smtp-Source: AMsMyM6taKPemUcsTfuG/Jj6/Hd9qYB0x9Wof3zVvHdrLQqojo5n/R1BfPrkgNJhLWLmMWLwljJ2FsKdWOu9xXTsFr8= X-Received: by 2002:a05:6a00:1a44:b0:52a:ecd5:bbef with SMTP id h4-20020a056a001a4400b0052aecd5bbefmr53657978pfv.28.1666960557317; Fri, 28 Oct 2022 05:35:57 -0700 (PDT) In-Reply-To: <83edusjhpe.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246420 Archived-At: On Fri, 28 Oct 2022 at 08:44, Eli Zaretskii wrote: > I don't have the necessary configuration here to try reproducing. You > said it doesn't happen when moving to trash just a small directory, so > it's quite clear that something specific to your system is at work here. This is no longer about `move-file-to-trash', but about `rename-file' third argument. So you don't need a freedesktop.org Trash to reproduce. Of course, it doesn't mean you can reproduce it, since there might still be something else which is system specific. I've tried to isolate things from the Trash issue, and I could reproduce the problem with the following steps. I grabbed two USB sticks, formatted both of them with EXT4 (I used Mint's "USB Stick formatter" tool, I suppose it is pretty standard in what it does), labeled each "orig" and "dest". Mounted both. In the terminal, I did: $ cd /path/to/orig $ mkdir barbaz $ cd barbaz $ dd if=/dev/zero of=zero.file bs=1024 count=204800 $ cd /path/to/dest $ mkdir barbaz-foobar I started "emacs -Q", and issued: (rename-file "/path/to/orig/barbaz" "/path/to/dest/barbaz-foobar" t) And got "(file-already-exists "File exists" "/path/to/dest/barbaz-foobar")" > Try figuring out why the make-directory call fails. What is the name > of the directory that fails the call, and why? I can try further, but I did try quite hard already. And I don't think this has anything to do with particular names, I used foo bar stuff above on purpose, and they are our quintessential "arbitrary". > Here are some questions for you to try to answer: > > . Does this happen only with moves across filesystems? Formally, what I tested is that when I tried the same recipe of the original report, but with the "org-mode" directory I was trying to delete/trash located in the same partition as the Trash, the error did not occur. So, the answer is that, as far as I can tell "yes", but the reasoning is based on small sample inference. "Educated" perhaps, but I can't make a rule out of it. > . Would any target filesystem do, or just some special kind(s)/ In the example above I used standard EXT4 ones. I'd say this should work on them, but I haven't tried other ones. Would you like me to test anything specific in this regard? > . What is the difference between the first move and the subsequent > moves that triggers the error? I think this question only applies to `move-file-to-trash', we don't need "two moves" anymore with the example boiled down to `rename-file'. We know `move-file-to-trash' does create an empty dir there, and this only happens when a file of the same name exists (which required the "first move"), but it also sets the `overwrite' flag, the problem is that the flag fails. Thank *you*.