From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Why does (file-exists-p "") return t?
Date: Thu, 09 Feb 2023 15:36:21 +0200 [thread overview]
Message-ID: <834jrvm04q.fsf@gnu.org> (raw)
In-Reply-To: <87y1p713ln.fsf@posteo.net> (message from Edgar Vincent on Thu, 09 Feb 2023 11:10:07 +0000)
> From: Edgar Vincent <e-v@posteo.net>
> Cc: help-gnu-emacs@gnu.org
> Date: Thu, 09 Feb 2023 11:10:07 +0000
>
> Gregory Heytings <gregory@heytings.org> writes:
>
> > (let ((default-directory “/nonexistent”)) (file-exists-p “”))
> >
> > returns nil.
>
> Thank you very much for your reply. This makes sense - and I’m sure it is mentioned somewhere
> in the documentation.
It is:
Expanding ‘.’ or the empty string returns the default directory:
(expand-file-name "." "/usr/spool/")
⇒ "/usr/spool"
(expand-file-name "" "/usr/spool/")
⇒ "/usr/spool"
next prev parent reply other threads:[~2023-02-09 13:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-09 10:41 Why does (file-exists-p "") return t? Edgar Vincent
2023-02-09 10:56 ` Gregory Heytings
2023-02-09 11:10 ` Edgar Vincent
2023-02-09 13:36 ` Eli Zaretskii [this message]
2023-02-09 21:05 ` Edgar Vincent
2023-02-10 4:20 ` Jean Louis
2023-02-11 10:10 ` Bruno Barbier
2023-02-11 11:28 ` Jean Louis
2023-02-11 19:34 ` Bruno Barbier
2023-02-11 10:39 ` Eli Zaretskii
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=834jrvm04q.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=help-gnu-emacs@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.
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).