[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Please confirm this file-name-directory behavior
From: |
Eli Zaretskii |
Subject: |
Re: Please confirm this file-name-directory behavior |
Date: |
Mon, 17 Sep 2007 06:04:31 +0200 |
> From: Mirko <mvukovic@nycap.rr.com>
> Date: Mon, 17 Sep 2007 02:46:12 -0000
>
> 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?
Yes.
The ELisp manual says (in the node that describes
file-name-directory):
On most systems, the directory part is everything up to and including
the last slash (backslash is also allowed in input on MS-DOS or
MS-Windows); the nondirectory part is the rest.
So if the file name ends with a slash, it's treated as a directory.