delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/01/29/17:12:07

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
To: cygwin AT cygwin DOT com
From: Graucsh <jgogolin AT tampabay DOT rr DOT com>
Subject: Re: Can cygwin be configured to always use mixed path output types?
Date: Thu, 29 Jan 2004 17:10:13 -0500
Lines: 95
Message-ID: <bvc0f1$ss2$1@sea.gmane.org>
References: <20040129201608 DOT 92607 DOT qmail AT web13904 DOT mail DOT yahoo DOT com> <Pine DOT GSO DOT 4 DOT 56 DOT 0401291536170 DOT 20756 AT slinky DOT cs DOT nyu DOT edu>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
Gmane-NNTP-Posting-Host: pcibizpdc.pciusa.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
In-Reply-To: <Pine.GSO.4.56.0401291536170.20756@slinky.cs.nyu.edu>

Igor Pechtchanski wrote:
> Dan,
> 
> My message was meant to say that Cygwin will accept Windows-style paths as
> input (the comment about path.cc was to make sure mixed-style paths were
> also accepted).  If you want Cygwin to *generate* Win32-style paths,
> that's unlikely to happen.  In fact, I can tell you right now that Cygwin
> is not going to be changed for better interoperability with either MKS or
> SFU.
> 
> The best solution for you might be to create aliases (or exported
> functions) for each of the necessary commands that would invoke 'cygpath'
> on the output of the corresponding command (something like
> 
> pwd() {
>   cygpath -m "`command pwd`"
> }
> export pwd
> 
> might do it).  Hope this helps,
> 	Igor
> 
> On Thu, 29 Jan 2004, Cohen Dan wrote:
> 
> 
>>Hi Igor et al.,
>>
>>Here is what I am seeing the cygwin command prompt:
>>
>>$ pwd
>>/cygdrive/c/temp
>>
>>Here is what I would like to see:
>>
>>$ pwd
>>c:/temp
>>
>>I am fairly new to cygwin and am not entirely certain about the solution
>>you are proposing.. (For example, what do you mean by "check the latest
>>version of winsup/cygwin/path.cc."?)
>>
>>In any case, If there is no solution to this, then I know my course of
>>action and would only ask in the future that cygwin environment and
>>tools support the two modes (Even if that means losing some symbolic
>>link and Cygwin mounting capabilities).
>>
>>If I am wrong, I would appreciate an example of how to set this up..
>>Thank you in advance.
>>
>>Dan
>>
>>
>>--- Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu> wrote:
>>
>>>On Thu, 29 Jan 2004, Cohen Dan wrote:
>>>
>>>
>>>>Hi,
>>>>
>>>>I have a project that requires me to use both cygwin and MKS.. MKS
>>>>primarily uses paths like "c:/temp" and cygwin has the path
>>>>"/cygdrive/c/temp".  I know I can use cygpath (cygpath -m
>>>>/cygdrive/c/temp) to convert the cygwin path to "c:/temp" but that
>>>>solution will be very time consuming to implement in the very large
>>>>application I need to convert. I was wondering if there was a way to
>>>>configure cygwin to work with the mixed path mode instead of using
>>>>cygpath in my scripts.
>>>>
>>>>Thanks in advance.
>>>>Dan
>>>
>>>FWIW, Cygwin's file manipulation routines will understand the regular
>>>Win32-style paths (make sure to quote the backslashes in your shell).
>>>Programs that don't attempt to manipulate the paths themselves should
>>>work just fine with Windows paths.  I believe (though I'm not as sure
>>>of it) that a 'single-letter-followed-by-a-colon-followed-by-a-slash'
>>>pattern is also used to indicate a Windows path and the DLL acts
>>>accordingly (i.e., mixed mode should also work).  If you want to make
>>>sure, look in the latest version of winsup/cygwin/path.cc.
>>>
>>>Of course, if some program does attempt to process the path itself
>>>(e.g., walk through directories, etc), all bets are off.  Also note
>>>that you will lose the benefit of Cygwin mounts and symlinks if you
>>>stick to Windows paths.
>>>      Igor
> 
> 
Or, if you want to keep your cygwin space unix-y and only have 
windows-style paths when mucking around under /cygdrive (one 
line)(requires sed):

alias pwd='pwd | sed "-es/^\/cygdrive\//:/" -eTz "-e s/\(:\)\(.\)/\2\1/" 
-e:a "-es/\//\\\/" -eta -e:z'

Hope That's Of Use


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