all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Barry Margolin <barmar@alum.mit.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: Please confirm this file-name-directory behavior
Date: Fri, 14 Sep 2007 21:26:54 -0400	[thread overview]
Message-ID: <barmar-EA97D3.21265414092007@comcast.dca.giganews.com> (raw)
In-Reply-To: mailman.873.1189784002.18990.help-gnu-emacs@gnu.org

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 ***

  parent reply	other threads:[~2007-09-15  1:26 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 [this message]
2007-09-17  2:46     ` Mirko
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=barmar-EA97D3.21265414092007@comcast.dca.giganews.com \
    --to=barmar@alum.mit.edu \
    --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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.