emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 627e7e0243: Improve documentation of 'file-exists-p'


From: Eli Zaretskii
Subject: emacs-29 627e7e0243: Improve documentation of 'file-exists-p'
Date: Sat, 17 Dec 2022 15:15:22 -0500 (EST)

branch: emacs-29
commit 627e7e0243d6df73b7cc93fb7a106a61c944b3bf
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Improve documentation of 'file-exists-p'
    
    * doc/lispref/files.texi (Testing Accessibility): Document better
    how to test for existing dangling symlinks.  (Bug#60146)
---
 doc/lispref/files.texi | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 4b45d89f9d..e2c3eb3341 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -895,10 +895,14 @@ permissions of the file itself.)
 If the file does not exist, or if there was trouble determining
 whether the file exists, this function returns @code{nil}.
 
-Directories are files, so @code{file-exists-p} can return @code{t} when
-given a directory.  However, because @code{file-exists-p} follows
-symbolic links, it returns @code{t} for a symbolic link
-name only if the target file exists.
+@cindex dangling symlinks, testing for existence
+Directories are files, so @code{file-exists-p} can return @code{t}
+when given a directory.  However, because @code{file-exists-p} follows
+symbolic links, it returns @code{t} for a symbolic link name only if
+the target of the link exists; if your Lisp program needs to consider
+@dfn{dangling symlinks} whose target doesn't exist as existing files,
+use @code{file-attributes} (@pxref{File Attributes}) instead of
+@code{file-exists-p}.
 @end defun
 
 @defun file-readable-p filename



reply via email to

[Prev in Thread] Current Thread [Next in Thread]