[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [h-e-w] Converting cygwin path to windows path
From: |
Dr Francis J. Wright |
Subject: |
Re: [h-e-w] Converting cygwin path to windows path |
Date: |
Wed, 13 Feb 2002 17:41:01 +0000 |
address@hidden wrote:
>
> Joe Riel <address@hidden> writes:
>
> > How do I convert a cygwin path (with forward slashes)
> > to the equivalent windows/dos path (with backslashes)?
> >
>
> > In my .emacs file I use the following so that, in dired, I can
> > launch a windows application. Usually it works as is, however, for
> > some path names it fails. Converting the forward slashes to
> > backslashes will work, is there a predefined procedure that does so?
> >
>
> emacs-21.1 has the new function "replace-regexp-in-string" to do such
> replacements.
>
> E.g. (replace-regexp-in-string "/" "\\\\" "c:/abc/def")
Unfortunately, it's not quite that simple. Cygwin pathnames do not
normally contain the DOS : syntax, and the only reliable way to map them
to DOS pathnames is via the mount table, which is done most easily by
calling cygpath, as already explained. (Although some (all?) Cygwin
programs accept DOS : syntax for individual pathnames, it cannot be used
in path values that are colon-separated pathnames.) Updating WoMan in
this respect is on my list of things to do!
Francis