This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Programatically finding value of "cygdrive" prefix


> > mount -p | sed -nr '2s/([^ ]) +\S+ +\S+$/\1/p'
> 
> how about a version that strips the leading slash?

mount -p | sed -nr '2s,/([^ ]) +\S+ +\S+$,\1,p'

> while we are at it, how do non-cygwin programs supposed to handle this
> /cygdrive stuff?

If you are invoking a non-cygwin program, you can use cygpath to
perform the conversion.  Write wrapper shell scripts to do that for
you if you commonly invoke non-cygwin programs from within cygwin.

> shell scripts mindlessly transfered from unix to cygwin do not bother to
> use cygpath before passing pathnames to external programs.
> native Emacs or vim do not appreciate /cygdrive prefixes.
> it's easier to tell Emacs how to handle /cygdrive than to fix every
> elisp Makefile that is being distributed.
> that brings me to suggest that this "cygdrive" be made available in the
> registry (which cygwin does not use at all, so, I guess, this is not
> going anywhere...)

Actually, the cygdrive prefix is part of mount(1), so it IS currently stored
in the registry.  But the registry interface to how mount(1) stores its
information is intentionally undocumented, so that mount(1) will work
even if its use of the registry changes in the future.

--
Eric Blake



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]