From: Mirko <mvukovic@nycap.rr.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Please confirm this file-name-directory behavior
Date: Mon, 17 Sep 2007 02:46:12 -0000 [thread overview]
Message-ID: <1189997172.468026.325500@g4g2000hsf.googlegroups.com> (raw)
In-Reply-To: <barmar-EA97D3.21265414092007@comcast.dca.giganews.com>
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
next prev parent reply other threads:[~2007-09-17 2:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-14 14:31 Please confirm this file-name-directory behavior Mirko
2007-09-14 15:01 ` Sven Joachim
2007-09-14 15:33 ` Eli Zaretskii
[not found] ` <mailman.873.1189784002.18990.help-gnu-emacs@gnu.org>
2007-09-15 1:26 ` Barry Margolin
2007-09-17 2:46 ` Mirko [this message]
2007-09-17 4:04 ` 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=1189997172.468026.325500@g4g2000hsf.googlegroups.com \
--to=mvukovic@nycap.rr.com \
--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).