This is the mail archive of the cygwin@cygwin.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]
Other format: [Raw text]

Re: echo and CYGWIN variable


On Fri, 23 May 2003, Ronald Landheer-Cieslak wrote:

> On Thu, 22 May 2003, Igor Pechtchanski wrote:
> > On Thu, 22 May 2003, Ronald Landheer-Cieslak wrote:
> > > On Wed, 21 May 2003, Igor Pechtchanski wrote:
> > > > Whenever you redirect to a file, the mount table is consulted, and the
> > > > appropriate mode is selected (i.e., CYGWIN has no effect).  If you use
> > > > Win32 paths, there are no entries in the mount table, so I'm not quite
> > > > sure what's going on.
> > > Correct me if I'm wrong (please), but I thought this worked like this:
> > > 1) d:/foo -> /cygdrive/d/foo
> > > 2) look in mount table
> > > the mount type (bin or text) is whatever the parent of /cygdrive/d/foo is,
> > > which is /cygdrive/d -> /cygdrive -> /
> > > if / is binmode, (and there's nothing between /cygdrive/d/foo and / in the
> > > mount table), /cygdrive/d/foo is binmode.
> > >
> > > But please, enlighten me if this is not how it works :)
> > >
> > > > You could try using backslashes instead of forward slashes (I think
> > > > those force textmode),
> > > If so, where does this:
> > > d:\\foo -> d:/foo -> /cygdrive/d/foo
> > > break?
> > >
> > > rlc
> >
> > That's not quite how it works, Ronald.  You were right in tracing back to
> > /cygdrive, but you should have realized that /cygdrive is a mount in
> > itself, and it will not get further reduced to "/".
> Of course, silly of me..
>
> > So, if you use the /cygdrive/d syntax, it will use the mode on the
> > /cygdrive mount.  If you use the d:\\ syntax, the files will be opened
> > using raw Win32 calls, and who knows what the mode will be (ISTR that it
> > defaults to text).
> And if you use the d:/ syntax, will that translate to the cygdrive syntax
> or to the d:\\ syntax?
>
> >From what I understand of your previous mail, if d:\\ forces textmode, but
> d:/ does not, d:/ is translated to /cygdrive/d whereas d:\\ is not.. Is
> this documented somewhere? (If not, I'll be happy to do the writing).
>
> rlc

Ronald,

I believe (and I hope someone will correct me if I'm wrong) that either a
'\' or a ':' in a normal filename forces textmode and bypasses the mount
table (IOW, d:/ and d:\\ are equivalent).  ISTR some discussions on
this...  Of course, the code is always your best reference (don't have
time to look myself just now).
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


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