[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Please confirm this file-name-directory behavior
From: |
Mirko |
Subject: |
Re: Please confirm this file-name-directory behavior |
Date: |
Mon, 17 Sep 2007 02:46:12 -0000 |
User-agent: |
G2/1.0 |
On Sep 14, 9:26 pm, Barry Margolin <bar...@alum.mit.edu> wrote:
> In article <mailman.873.1189784002.18990.help-gnu-em...@gnu.org>,
> Eli Zaretskii <e...@gnu.org> wrote:
>
> > > From: Mirko <mvuko...@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, bar...@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 ***
First, thank you to all who posted.
Continuing, what is the expected behavior if the argument does not end
in a slash, like
(file-name-directory "~/foo/bar/") vs (file-name-directory "~/foo/
bar")
On windows, the first form returns the full argument, while the
second "~/foo/". Is that
the expected behavior?
These question stem from a problem I am having with emacs-muse, and I
am trying
to figure out whether this is a consequence of the windows version of
emacs, or
something else.
Thank you very much to all.
Mirko