This is the mail archive of the cygwin@sources.redhat.com 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]

RE: Strange cd/CDPATH behavior


> -----Original Message-----
> From: Chris Faylor [mailto:cgf@cygnus.com]
> Sent: Tuesday, September 26, 2000 7:56 PM
> To: cygwin@sourceware.cygnus.com
> Subject: Re: Strange cd/CDPATH behavior
> 
> 
> On Tue, Sep 26, 2000 at 11:40:54AM -0600, Erik Nolte wrote:
> >> > The obvious answer is to stop using DOS style paths with 
> cygwin cd's.
> >> > Unfortunately, what I'm really doing is "cd $SRC_PATH" 
> where SRC_PATH is
> >> > "W:/src".  SRC_PATH must be a DOS style path to keep 
> javac and other
> >> > windows-based software happy (they can't grok paths without drive
> >> letters).
> >>
> >> Use cygpath...
> >> >cygpath -u -p c:/
> >> /
> >>
> >> In your example, something like:
> >> cd $(cygpath -u -p $SRC_PATH)
> >> would probably work.
> >
> >
> >I wish I could, unfortunately the cd's are inside makefiles 
> and scripts that
> >run both on cygwin/NT/Win2K and on Solaris.  And the Suns 
> aren't too happy
> >about cygpath.  I can hack around the problem by unsetting CDPATH or
> >creating a SHELL_SRC_PATH (/c) and a APP_SRC_PATH (c:/).  
	...
> 
> FWIW, I haven't seen anyone mention that this is a *bash* 
> idiosyncrasy.  Bash is
> apparently not dealing well with c:\foo style paths, which is 
> hardly surprising.

We had the same kind of problems in our port of UNIX tools to Windows
(having the tools correctly handling X:/foo as an absolute path) and the
only solution we found was looking at all the places in our source code base
where we compare something with '/' then manually check iw we were looking
for an absolute path, then if true recode it to call some locally defined
macro (IS_ABSOLUTE_PATH) that depending on the platform either check the
first char (on UNIX) or call some function that is able to handle drive
letters correctly ;-(

We were quite reluctant at having to do that but we do not find any other
way to handle correctly DOS-style path names. Note that we even have more
hard time trying to handle DOS-style path names in UNIX-style
(':'-separated) path lists, but this is another story :-) (I can describe
how we do that if anybody is interested).

> 
> I doubt that these problems show up in Solaris since there is 
> no possibility
> that you'll ever see a x:\ path there.  

I think what he wants to say is that he can't rewrite its makefile rules
using cd `cygpath ${SRC_DIR}` as Solaris will choke on cygpath :-) and he
has to have the same makefiles for UNIX and CYGWIN (after all this *was* the
reason of creating cygwin: be able to port UNIX packages to Windows).

Just my .02EUR

	Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


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