bug-gnu-emacs
[Top][All Lists]
Advanced

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

Re: file-readable-p returns t for empty string


From: Eli Zaretskii
Subject: Re: file-readable-p returns t for empty string
Date: Tue, 26 Feb 2002 20:59:04 +0200

> From: "=?ISO-8859-1?Q?J=E4rnestr=F6m Jonas?=" <address@hidden>
> Date: Tue, 26 Feb 2002 19:46:05 +0100 (MET)
> 
> (file-readable-p "") returns t.
> Wouldnt nil be more appropriate since there is no filename to visit
> (or whatever) despite the returning t?
> Same behavior for its peers like file-exists-p an so on...

That's because all these primitives call expand-file-name internally,
and expand-file-name returns the buffer's default directory when
passed an empty string as an argument.

I don't know off the top of my head why does expand-file-name do that.



reply via email to

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