From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 25 10:40:31 2019 Received: (at submit) by debbugs.gnu.org; 25 Oct 2019 14:40:32 +0000 Received: from localhost ([127.0.0.1]:39204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iO0lT-0000cq-Fu for submit@debbugs.gnu.org; Fri, 25 Oct 2019 10:40:31 -0400 Received: from lists.gnu.org ([209.51.188.17]:53859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iO081-0007y2-0w for submit@debbugs.gnu.org; Fri, 25 Oct 2019 09:59:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40199) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iO07z-00067s-6C for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2019 09:59:44 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, 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 ) id 1iO07x-0005tr-Rt for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2019 09:59:43 -0400 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:36605) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iO07x-0005tT-Ne for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2019 09:59:41 -0400 Received: by mail-qk1-x732.google.com with SMTP id y189so1834911qkc.3 for ; Fri, 25 Oct 2019 06:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=nSrTLsmyemxYytFCeWxzQJx1jBfm87sIKW+WwFyjSnk=; b=NEPU0IlWpQDtyEDi6oy+OocrsL/ZT+3YLrueetvftJxVFrykypUr20U/FCLqpmgwZe YXhrp3K+RIVsVj6QySztQYbWnEuEdvAmkNXLIeo1SPimPrB1uBzP5+MZjFS1ihv0xoRf HAg2GdZn8fEOHVmeSHwabdWP62kNXyDk5wjfP+Ap191W5QkmeQDNZMLQlHxcCRgxRLm7 UqRKC3BnnXsSnzGTLf++BFnIknmJuxFTzt/fZKhLGjliLg+wcDSRf1dfmYitl9yEoAjW nPtbx5PoDIRzPArqsLbQtG/LbJDqeAhMlxpwBnM/JEy+fJsdfbq6gGuUepGAcgn/6riP 3/Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=nSrTLsmyemxYytFCeWxzQJx1jBfm87sIKW+WwFyjSnk=; b=NOEJtY9lxSvpxzIeCNKzi4sf6wz1XFXDpN543eWr6B/Isv0Z371WW5Op2kkKyU5Cn6 za9rq9PaWF3t3qpYXE+cTcoZQMF0ewNC9lyYKjChSPV3v3AUFe7NkySRccyxwj7As9IS DHqyu0Y+GWzLXpSWwdOENiQzme9oS7BIjOwweJlkX6+uWp0jXj/9rK0r83b2jUY9icIB RU/+I9SkiRVVOuCCklqkSTgmtRYdO1SK7b0ul7SpbK5eS1to4Rnaw/fXpczBmnptaL5t qvrtpwuK3haFVutLDLNnZSEKIwUtf73S2xZTF0Yg91N1WLWIti2gPMVYfkHV9OQ5KWyG yntA== X-Gm-Message-State: APjAAAU/RJ2Ak71mmptPEM/dhO1vq6Lfqw7BjTNZs1/BMvmj3GKjGRPT avpyLDsXGPnsmIgLGk0h2P3mjeAd0i3FsEYbJjUwB88y X-Google-Smtp-Source: APXvYqw8U0je1/tQhP58zBWF8Lay7MoeZ2bDmQOErtU0p1ptN1/4bPYl5uqU/zsYJUFmHPJpG7M6sftZinV84arUVuo= X-Received: by 2002:a37:4e82:: with SMTP id c124mr3085955qkb.228.1572011980518; Fri, 25 Oct 2019 06:59:40 -0700 (PDT) MIME-Version: 1.0 From: Shingo Tanaka Date: Fri, 25 Oct 2019 22:59:28 +0900 Message-ID: Subject: 26.3; move-file-to-trash puts wrong trash file name at name collision To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000ae78d50595bc8f90" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::732 X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 25 Oct 2019 10:40:30 -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: -2.1 (--) --000000000000ae78d50595bc8f90 Content-Type: text/plain; charset="UTF-8" Hi, When delete-by-moving-to-trash is t and system-move-file-to-trash is not defined, move-file-to-trash moves the deleted file to system trash can following freedesktop.org trash can specification. In this condition, when a file is deleted and it has the same name as the one of an already deleted file in trash can, move-file-to-trash generates another file name by using make-temp-file to avoid the name collision. Unfortunately, it does put a wrong name with suffix ".trashinfo". For example, when 2 "hoge.txt" are deleted, expected files are like: /home/myusername/.local/share/Trash/files: -rw-rw-rw- 1 myusername 10 2019-10-25 20:00 hoge.txt -rw-rw-rw- 1 myusername 10 2019-10-25 20:00 hoge.txtwmWP0h /home/myusername/.local/share/Trash/info: -rw-rw-rw- 1 myusername 75 2019-10-25 20:00 hoge.txt.trashinfo -rw------- 1 myusername 75 2019-10-25 20:00 hoge.txtwmWP0h.trashinfo However, the reality is the 2nd trash file in files directory is named wrongly with ".trashinfo" suffix like: /home/myusername/.local/share/Trash/files: -rw-rw-rw- 1 myusername 10 2019-10-25 20:00 hoge.txt -rw-rw-rw- 1 myusername 10 2019-10-25 20:00 hoge.txtwmWP0h.trashinfo ^^^^^^^^^ /home/myusername/.local/share/Trash/info: -rw-rw-rw- 1 myusername 75 2019-10-25 20:00 hoge.txt.trashinfo -rw------- 1 myusername 75 2019-10-25 20:00 hoge.txtwmWP0h.trashinfo Here is a potential patch. --- files.el.original 2019-09-17 05:14:45.000000000 +0900 +++ files.el 2019-10-25 20:52:13.899138800 +0900 @@ -7408,7 +7408,8 @@ (setq info-fn (make-temp-file (expand-file-name files-base trash-info-dir) nil ".trashinfo")) - (setq files-base (file-name-nondirectory info-fn)) + (setq files-base (substring (file-name-nondirectory info-fn) + 0 (- (length ".trashinfo")))) (write-region nil nil info-fn nil 'quiet info-fn))) ;; Finally, try to move the file to the trashcan. (let ((delete-by-moving-to-trash nil) --- Shingo Tanaka --000000000000ae78d50595bc8f90 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

When delete-by-moving-to-tras= h is t and system-move-file-to-trash is not defined, move-file-to-trash mov= es the deleted file to system trash can following freedesktop.org trash can specification.

In this condi= tion, when a file is deleted and it has the same name as the one of an alre= ady deleted file in trash can, move-file-to-trash generates another file na= me by using make-temp-file to avoid the name collision.=C2=A0 Unfortunately= , it does put a wrong name with suffix ".trashinfo".

For e= xample, when 2 "hoge.txt" are deleted, expected files are like:
/home/myusername/.local/share/Trash/files:
-rw-rw-rw- 1 myusername= =C2=A010 2019-10-25 20:00 hoge.txt
-rw-rw-rw- 1 myusername =C2=A010 201= 9-10-25 20:00 hoge.txtwmWP0h

/home/myusername/.local/share/Trash/inf= o:
-rw-rw-rw- 1 myusername =C2=A075 2019-10-25 20:00 hoge.txt.trashinfo<= br>-rw------- 1 myusername =C2=A075 2019-10-25 20:00 hoge.txtwmWP0h.trashin= fo

However, the reality is the 2nd trash file in files directory is = named wrongly with ".trashinfo" suffix like:

/home/myusern= ame/.local/share/Trash/files:
-rw-rw-rw- 1 myusername =C2=A010 2019-10-2= 5 20:00 hoge.txt
-rw-rw-rw- 1 myusername =C2=A010 2019-10-25 20:00 hoge.= txtwmWP0h.trashinfo
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ^^^^^^^^^
/home/myusername/.local/share/Trash/info:
-rw-rw= -rw- 1 myusername =C2=A075 2019-10-25 20:00 hoge.txt.trashinfo
-rw------= - 1 myusername =C2=A075 2019-10-25 20:00 hoge.txtwmWP0h.trashinfo

He= re is a potential patch.

--- files.el.original 2019-09-17 05:14:45.0= 00000000 +0900
+++ files.el 2019-10-25 20:52:13.899138800 +0900
@@ -7= 408,7 +7408,8 @@
=C2=A0 =C2=A0 =C2=A0(setq info-fn (make-temp-file
= =C2=A0 =C2=A0 (expand-file-name files-base trash-info-dir)
=C2=A0 = =C2=A0 nil ".trashinfo"))
- =C2=A0 =C2=A0(setq files-base = (file-name-nondirectory info-fn))
+ =C2=A0 =C2=A0(setq files-base (sub= string (file-name-nondirectory info-fn)
+ 0 (- (length ".trash= info"))))
=C2=A0 =C2=A0 =C2=A0(write-region nil nil info-fn nil &= #39;quiet info-fn)))
=C2=A0 ;; Finally, try to move the file to the tr= ashcan.
=C2=A0 (let ((delete-by-moving-to-trash nil)

---
Shi= ngo Tanaka
--000000000000ae78d50595bc8f90-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 26 21:51:14 2019 Received: (at 37922) by debbugs.gnu.org; 27 Oct 2019 01:51:14 +0000 Received: from localhost ([127.0.0.1]:41568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOXi5-0000Si-W1 for submit@debbugs.gnu.org; Sat, 26 Oct 2019 21:51:14 -0400 Received: from mail-pf1-f179.google.com ([209.85.210.179]:38224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOXi2-0000SU-SM for 37922@debbugs.gnu.org; Sat, 26 Oct 2019 21:51:12 -0400 Received: by mail-pf1-f179.google.com with SMTP id c13so4259630pfp.5 for <37922@debbugs.gnu.org>; Sat, 26 Oct 2019 18:51:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:from:to:subject:in-reply-to:references:user-agent :mime-version; bh=1xhi4ZuRroMOADE7T3H1nNMknLGOW62Rf1kEWqS0JDI=; b=NuFfetZPFB4JZihzJxDDnJuQmCDKHg5v9DcTMZbXLWlpva1Yv5aa4E1m/xV1GuDRsj CUND93skHGFg3fT9UpzpajRCc8VFevxgQMkBqcmdrrX1DnJKmMyvaXmshJpuyV3y5qbM K3WfspF8sYaqg0kKV9auQKxZrMceVrfDGomqKpb+lZ4wKFwllULeeI9+7DIwYg+lVz+Y kTPPq4f1SPo2/k/HnggvdQJzwh24b8h0rTBZ7u0QFrIEPPKQm7nkaBxA98Fd8FYpvujz Oru6F3iouhUQ8CS1H5EWaT7wUKsR308HMb0v8jeyb3R40k5pTsGQm5uMSG9yOyUI5H/l J/ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:from:to:subject:in-reply-to :references:user-agent:mime-version; bh=1xhi4ZuRroMOADE7T3H1nNMknLGOW62Rf1kEWqS0JDI=; b=aG1APIIwdCeBgLcxlRzhvt/5GaMtKfK8qmaoJqOjpD9qqN3K86qCXgfZStVJTf+i+r 209RivR7mlJ2Bu3P1T5mwee3mGFONmUvyS1rf756uo30MtpI7n7hp1zjCGbbrDO8ZUK9 YTSDElJ7WHo78gFpLnMnRzy4s45RkQkACkTlu2k4diQadQVkP+U/aG/0Vi8fIEhrLCuV PxG+Avs4Zi8Z5GmD+cW1acumFndF/r1HkYsl9SEM2D5sXGQs8VKNn9xP1bMY3M2+fACA hcrYIFc8MSYMy2SQGePSYoc5MkgwY07wnHdrKGfECQ5nHXqWSRS5QkkfP4m275c7EOwM 80uQ== X-Gm-Message-State: APjAAAVbmmhOCIRvw4LouZ3jSXzUgG6gt9n8xlLURPJkx5Qi40pVu+1f nzYgGjWJgaOjB9v4o5jb0SayeBBw X-Google-Smtp-Source: APXvYqzihrNdK8tG6jP48H52Tyq3TprbFLbbFSyEgRBlwmyeSa4B9oY2LGfg1F/y/ajbcO1orFQVvg== X-Received: by 2002:a63:d703:: with SMTP id d3mr13252414pgg.102.1572141064288; Sat, 26 Oct 2019 18:51:04 -0700 (PDT) Received: from P8E197343H.gmail.com ([240f:36:d353:1:3467:c0b7:d1f7:5162]) by smtp.gmail.com with ESMTPSA id t11sm6260659pjy.10.2019.10.26.18.51.03 for <37922@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Oct 2019 18:51:03 -0700 (PDT) Date: Sun, 27 Oct 2019 10:51:01 +0900 Message-ID: <87pnijufay.wl-shingo.fg8@gmail.com> From: Shingo Tanaka To: 37922@debbugs.gnu.org Subject: Re: bug#37922: Acknowledgement (26.3; move-file-to-trash puts wrong trash file name at name collision) In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 37922 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.7 (/) # Resending it as I sent the original mail in HTML format by mistake... Hi, When delete-by-moving-to-trash is t and system-move-file-to-trash is not defined, move-file-to-trash moves the deleted file to system trash can following freedesktop.org trash can specification. In this condition, when a file is deleted and it has the same name as the one of an already deleted file in trash can, move-file-to-trash generates another file name by using make-temp-file to avoid the name collision. Unfortunatelly, it does the naming in a wrong way. For example, when 2 "hoge.txt" are deleted, expected files are like: /home/myusername/.local/share/Trash/files: -rw-rw-rw- 1 myusername 10 2019-10-25 20:00 hoge.txt -rw-rw-rw- 1 myusername 10 2019-10-25 20:00 hoge.txtwmWP0h /home/myusername/.local/share/Trash/info: -rw-rw-rw- 1 myusername 75 2019-10-25 20:00 hoge.txt.trashinfo -rw------- 1 myusername 75 2019-10-25 20:00 hoge.txtwmWP0h.trashinfo However, the reality is the 2nd trash file in files directory is named wrongly with ".trashinfo" suffix like: /home/myusername/.local/share/Trash/files: -rw-rw-rw- 1 myusername 10 2019-10-25 20:00 hoge.txt -rw-rw-rw- 1 myusername 10 2019-10-25 20:00 hoge.txtwmWP0h.trashinfo ^^^^^^^^^ /home/myusername/.local/share/Trash/info: -rw-rw-rw- 1 myusername 75 2019-10-25 20:00 hoge.txt.trashinfo -rw------- 1 myusername 75 2019-10-25 20:00 hoge.txtwmWP0h.trashinfo Here is a potential patch. --- files.el.original 2019-09-17 05:14:45.000000000 +0900 +++ files.el 2019-10-25 20:52:13.899138800 +0900 @@ -7408,7 +7408,8 @@ (setq info-fn (make-temp-file (expand-file-name files-base trash-info-dir) nil ".trashinfo")) - (setq files-base (file-name-nondirectory info-fn)) + (setq files-base (substring (file-name-nondirectory info-fn) + 0 (- (length ".trashinfo")))) (write-region nil nil info-fn nil 'quiet info-fn))) ;; Finally, try to move the file to the trashcan. (let ((delete-by-moving-to-trash nil) --- Shingo Tanaka From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 07 20:03:01 2019 Received: (at control) by debbugs.gnu.org; 8 Nov 2019 01:03:01 +0000 Received: from localhost ([127.0.0.1]:44184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSsg1-0002Qv-B8 for submit@debbugs.gnu.org; Thu, 07 Nov 2019 20:03:01 -0500 Received: from host.gofardesign.uk ([208.79.239.190]:37144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iSsfz-0002Qh-74 for control@debbugs.gnu.org; Thu, 07 Nov 2019 20:02:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Subject:From:To:Date:Sender:Reply-To:Message-ID:Cc:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=a4hfxxrNSCfwW0jHIxfZ4GI8xXmleqUTxwalj5BW3f4=; b=MqCI0tnYgh433GZkVETPnAdv+7 xPwAz204C49kYlEAztClPMyuzfyGeiZ5DUpmkv08ZvvGqs7LBvOlel/zJIIq2FYZxVDVrAJa0F7A3 1dZwym1+r1oYrf6L0QG1AuF6x0JQQI30rT5Yf0C9xcHPiR7rdYabLU/AIF6CckYJgt64=; Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:48694 helo=localhost) by host.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iSsfs-0000bG-QU for control@debbugs.gnu.org; Thu, 07 Nov 2019 19:02:53 -0600 Date: Fri, 08 Nov 2019 02:02:51 +0100 To: control@debbugs.gnu.org From: Stefan Kangas Subject: control message for bug #37922 X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: host.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: host.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: control 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" Message-Id: X-Spam-Score: -1.0 (-) tags 37922 + easy quit From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 16 07:56:48 2019 Received: (at 37922-done) by debbugs.gnu.org; 16 Nov 2019 12:56:49 +0000 Received: from localhost ([127.0.0.1]:37833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iVxdA-0001zU-MH for submit@debbugs.gnu.org; Sat, 16 Nov 2019 07:56:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iVxd7-0001zF-CC for 37922-done@debbugs.gnu.org; Sat, 16 Nov 2019 07:56:48 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iVxd2-0005aO-5h; Sat, 16 Nov 2019 07:56:40 -0500 Received: from [176.228.60.248] (port=1428 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iVxd1-0008Sh-Er; Sat, 16 Nov 2019 07:56:39 -0500 Date: Sat, 16 Nov 2019 14:56:37 +0200 Message-Id: <83a78w6ku2.fsf@gnu.org> From: Eli Zaretskii To: Shingo Tanaka In-reply-to: (message from Shingo Tanaka on Fri, 25 Oct 2019 22:59:28 +0900) Subject: Re: bug#37922: 26.3; move-file-to-trash puts wrong trash file name at name collision References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 37922-done Cc: 37922-done@debbugs.gnu.org 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: -3.3 (---) > From: Shingo Tanaka > Date: Fri, 25 Oct 2019 22:59:28 +0900 > > When delete-by-moving-to-trash is t and system-move-file-to-trash is not > defined, move-file-to-trash moves the deleted file to system trash can > following freedesktop.org trash can specification. > > In this condition, when a file is deleted and it has the same name as the > one of an already deleted file in trash can, move-file-to-trash generates > another file name by using make-temp-file to avoid the name collision. > Unfortunately, it does put a wrong name with suffix ".trashinfo". > > For example, when 2 "hoge.txt" are deleted, expected files are like: > > /home/myusername/.local/share/Trash/files: > -rw-rw-rw- 1 myusername 10 2019-10-25 20:00 hoge.txt > -rw-rw-rw- 1 myusername 10 2019-10-25 20:00 hoge.txtwmWP0h > > /home/myusername/.local/share/Trash/info: > -rw-rw-rw- 1 myusername 75 2019-10-25 20:00 hoge.txt.trashinfo > -rw------- 1 myusername 75 2019-10-25 20:00 hoge.txtwmWP0h.trashinfo > > However, the reality is the 2nd trash file in files directory is named > wrongly with ".trashinfo" suffix like: > > /home/myusername/.local/share/Trash/files: > -rw-rw-rw- 1 myusername 10 2019-10-25 20:00 hoge.txt > -rw-rw-rw- 1 myusername 10 2019-10-25 20:00 hoge.txtwmWP0h.trashinfo > ^^^^^^^^^ > /home/myusername/.local/share/Trash/info: > -rw-rw-rw- 1 myusername 75 2019-10-25 20:00 hoge.txt.trashinfo > -rw------- 1 myusername 75 2019-10-25 20:00 hoge.txtwmWP0h.trashinfo > > Here is a potential patch. Thanks, I installed this. From unknown Mon Aug 18 11:27:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 15 Dec 2019 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator