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

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

Re: Please confirm this file-name-directory behavior


From: Barry Margolin
Subject: Re: Please confirm this file-name-directory behavior
Date: Fri, 14 Sep 2007 21:26:54 -0400
User-agent: MT-NewsWatcher/3.5.2 (PPC Mac OS X)

In article <mailman.873.1189784002.18990.help-gnu-emacs@gnu.org>,
 Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Mirko <mvukovic@nycap.rr.com>
> > Date: Fri, 14 Sep 2007 14:31:24 -0000
> > 
> > I am running Emacs 22.1.1 on Windows XP, and I observe that file-name-
> > directory does not check whether the actual directory exists.  It just
> > parses the string argument for the directory & file parts.
> > 
> > I am not complaining about it not checking whether the directory
> > exists, I just want to confirm that this behavior is by design.
> 
> It's by design.  file-name-directory is driven by syntax of file
> names, not by whether files or directories exist.

And it's easy to explain why it works this way.  Suppose you wanted a 
function that creates a file, as well as its directory if necessary.  It 
will call file-name-directory to get the directory name, and then check 
whether the directory exists to determine if it needs to create it.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***


reply via email to

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