William M. Perry wrote:
I would say that the file munging routines under win32 should NOT change
the path separators. They should leave them the same as what they got.
So:
(file-name-directory "/foo/bar/baz")
=> "/foo/bar"
(file-name-directory "\\foo\\bar\\baz")
=> "\\foo\\bar"
(file-name-nondirectory "/foo/bar/baz")
=> "baz"
> Alternatively, is there a better approach than manually replacing
> selective calls to XEmacs path handling functions with string matches?
I would ask someone to implement the above... at least for
the file-name-(non)*directory functions.
On reflection I can't see any reason why directory-file-name or
file-name-directory should correct path separators under native
mswindows (they don't do any similar processing under UNIX). I think
that Kirill was going overboard here. file-name-nondirectory already
doesn't do any such processing under native mswindows or under UNIX.
expand-file-name does correct path separators. This is correct because
the doc string says "Convert filename NAME to absolute, and canonicalize
it."
file-name-as-directory has to add the appropriate separator (ie '\\' on
native mswindows) to the file name in order to make filename completion
work correctly. Unfortunately this breaks efs on nt; I'll take this up
with the efs maintainer separtely.
Unless anyone has objections, I'll send out a patch tonight to remove
the separator munging from directory-file-name and file-name-directory.
This will make w3 work on native mswindows, and also will help towards
making efs work on native mswindows.
Jonathan.
--
Jonathan Harris | jhar(a)tardis.ed.ac.uk
London, England | Jonathan.Harris(a)symbian.com