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: David Kastrup
Subject: Re: file-readable-p returns t for empty string
Date: 28 Feb 2002 13:41:17 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50

address@hidden (Eli Zaretskii) writes:

> On 28 Feb 2002, David Kastrup wrote:
> 
> > > Do you mean, return ""?
> > 
> > Yes.
> > 
> > > That would violate the principle that expand-file-name always
> > > returns an absolute file name.
> > 
> > Absolute file names come in a variety of flavours.  They do not need
> > to start with "/".  For example, there are systems where they start
> > with the equivalent of "C:" before the first root /, or even
> > "/address@hidden:".  So what is it that qualifies an absolute file
> > name?

[you snipped: my contention that it shoud behave the same regardless
of the current work directory]

> See file-name-absolute-p.  It says that in Emacs, a file name is absolute 
> if it satisfies one of these conditions:
> 
>   - begins with a directory separator (normally `/')
> 
>   - begins with a `~'
> 
>   - on DOS/Windows systems begins with a drive letter

Well, I doubt we have many programs that do the equivalent of
(while (not (file-name-absolute-p file))
        (setq file (expand-file-name file)))

Even if one did, file-name-absolute-p is highly system dependent.
One could make it return t for "" as well if one was so inclined.  I
rather doubt that applications rely on certain semantics of
file-name-absolute-p for illegal file names.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: address@hidden



reply via email to

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