From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#47135: 28.0.50; move to trash does not work if symlink is in Trash Date: Thu, 18 Mar 2021 07:16:07 +0100 Message-ID: <87o8fhrnq0.fsf@gnus.org> References: <86im5udrz6.fsf@protected.rcdrun.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12261"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 47135@debbugs.gnu.org To: Jean Louis Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 18 07:17:19 2021 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 1lMlyA-00035V-Qh for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 Mar 2021 07:17:18 +0100 Original-Received: from localhost ([::1]:41002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMly9-0006NU-Jq for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 Mar 2021 02:17:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMlxy-0006NJ-Pv for bug-gnu-emacs@gnu.org; Thu, 18 Mar 2021 02:17:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33149) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMlxu-0007pM-Al for bug-gnu-emacs@gnu.org; Thu, 18 Mar 2021 02:17:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lMlxu-0005FZ-6u for bug-gnu-emacs@gnu.org; Thu, 18 Mar 2021 02:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Mar 2021 06:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47135 X-GNU-PR-Package: emacs Original-Received: via spool by 47135-submit@debbugs.gnu.org id=B47135.161604818220100 (code B ref 47135); Thu, 18 Mar 2021 06:17:02 +0000 Original-Received: (at 47135) by debbugs.gnu.org; 18 Mar 2021 06:16:22 +0000 Original-Received: from localhost ([127.0.0.1]:44689 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMlxG-0005E7-I7 for submit@debbugs.gnu.org; Thu, 18 Mar 2021 02:16:22 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:39348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMlxB-0005Dd-Op for 47135@debbugs.gnu.org; Thu, 18 Mar 2021 02:16:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=IHpIyCAjgRr4EXRhEVxV0x5r4bnOC29jX4se9q9kuLA=; b=AFDuZv/zKCgWqJQ30bntte8XlR 6fI+6+acrsbEOvx0fdceTCrYdSDSqWk132aVlWtRMBk6ASw3Ak8c1wryn2+3NMJPh+aK7GilXwPOL WAJBOM1SH7ixUyVPtU0ys65FrTbKhZ1VRS5U53JAsR5oonRt9nqsSMTo6eHF6tUHD5iI=; Original-Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMlx2-0000Rb-N8; Thu, 18 Mar 2021 07:16:11 +0100 X-Now-Playing: =?UTF-8?Q?A=CE=A3TYTEKK,?= Levadian Hater's _Natural Sciences: Age in Decline_: "Bich Contest" In-Reply-To: <86im5udrz6.fsf@protected.rcdrun.com> (Jean Louis's message of "Sun, 14 Mar 2021 12:06:37 +0300") 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:202561 Archived-At: Jean Louis writes: > Here I have discovered condition when it does not work. > > In my trash there is this file: > > lrwxrwxrwx 1 175 Jun 18 2019 Rock-and-Mineral-Identification.pdf -> /home/admin/Books/Geology/Rock-and-Mineral-Identification.pdf > > And then I have the directory, /home/admin/other/ where one can see this > file: > > D -rw------- 1 5.6M Aug 13 2018 Rock-and-Mineral-Identification.pdf > > if I try to delete with x, I get this message: > > file-already-exists: File already exists: > /home/data1/protected/tmp/Trash/Rock-and-Mineral-Identification.pdf The problem is more general -- any file that exists already in the trash directory leads to this problem. To test: touch /home/larsi/.local/share/Trash/files/foo touch /tmp/foo Then "d" the file in dired, and x, and then you'll get the error. That's because the code in move-file-to-trash only checks whether the .trashinfo file exists: ;; Make a .trashinfo file. Use O_EXCL, as per trash-spec 1.0. (let* ((files-base (file-name-nondirectory fn)) (info-fn (expand-file-name (concat files-base ".trashinfo") trash-info-dir))) (condition-case nil (write-region nil nil info-fn nil 'quiet info-fn 'excl) (file-already-exists ;; Uniquify new-fn. Some file managers do not ;; like Emacs-style backup file names. E.g.: ;; https://bugs.kde.org/170956 (setq info-fn (make-temp-file (expand-file-name files-base trash-info-dir) nil ".trashinfo")) (setq files-base (substring (file-name-nondirectory info-fn) 0 (- (length ".trashinfo")))) And then creates a new, unique name. A .trashinfo file should exist, of course, but here the Trash directory is out of sync, and Emacs should handle that better, I guess. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no