unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Shingo Tanaka <shingo.fg8@gmail.com>
Cc: 37922-done@debbugs.gnu.org
Subject: bug#37922: 26.3; move-file-to-trash puts wrong trash file name at name collision
Date: Sat, 16 Nov 2019 14:56:37 +0200	[thread overview]
Message-ID: <83a78w6ku2.fsf@gnu.org> (raw)
In-Reply-To: <CAH4H2-xqJ5Yd+03oF1-9gSa7mwzEcGLXcwMEUJevBaBnMyMbKA@mail.gmail.com> (message from Shingo Tanaka on Fri, 25 Oct 2019 22:59:28 +0900)

> From: Shingo Tanaka <shingo.fg8@gmail.com>
> 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.





      parent reply	other threads:[~2019-11-16 12:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25 13:59 bug#37922: 26.3; move-file-to-trash puts wrong trash file name at name collision Shingo Tanaka
     [not found] ` <handler.37922.B.15720144322418.ack@debbugs.gnu.org>
2019-10-27  1:51   ` bug#37922: Acknowledgement (26.3; move-file-to-trash puts wrong trash file name at name collision) Shingo Tanaka
2019-11-16 12:56 ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83a78w6ku2.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=37922-done@debbugs.gnu.org \
    --cc=shingo.fg8@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).