delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/11/10:10:18

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: ericblake AT comcast DOT net (Eric Blake)
To: sds AT gnu DOT org, cygwin AT cygwin DOT com
Subject: Re: Programatically finding value of "cygdrive" prefix
Date: Thu, 11 Aug 2005 14:10:05 +0000
Message-Id: <081120051410.11364.42FB5C3D0008A6CD00002C6422064246130A050E040D0C079D0A@comcast.net>
X-Authenticated-Sender: ZXJpY2JsYWtlQGNvbWNhc3QubmV0

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019