all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: 60146@debbugs.gnu.org
Subject: bug#60146: file-exists-in-trash-p needs better name or semantics
Date: Fri, 16 Dec 2022 21:17:13 -0800	[thread overview]
Message-ID: <d0203c75-4499-8d23-7acd-fde36d47b718@cs.ucla.edu> (raw)

The recently-added function (file-exists-in-trash-p FILE) is poorly 
named since it's not really related to trash - it's simply checking for 
the existence of a directory entry named FILE.

How about extending file-exists-p instead? (file-exists-p FILE t) would 
be like (file-exists-p FILE) except it would not follow symlinks. This 
extension can be implemented via a single system call on POSIX systems, 
and this would be more efficient and would avoid a race in the current 
implementation of file-exists-in-trash-p. (Though of course pretty much 
any use of this new function makes one vulnerable to races....)

If extending file-exists-p is too much, at least please rename 
file-exists-in-trash-p to something like files--exists-nofollow-p, to 
indicate that it's private to files.el and to say better what it means.






             reply	other threads:[~2022-12-17  5:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-17  5:17 Paul Eggert [this message]
2022-12-17  8:47 ` bug#60146: file-exists-in-trash-p needs better name or semantics Eli Zaretskii
2022-12-17 15:51   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-17 17:45     ` Eli Zaretskii
2022-12-17 19:57   ` Paul Eggert
2022-12-17 20:09     ` Eli Zaretskii
2022-12-17 23:55       ` Paul Eggert
2022-12-17 10:01 ` Michael Albinus

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

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

  git send-email \
    --in-reply-to=d0203c75-4499-8d23-7acd-fde36d47b718@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=60146@debbugs.gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.