Added some interesting functionality to my cygwin sandbox

Igor Pechtchanski
Wed Jul 2 17:50:00 GMT 2003

On Wed, 2 Jul 2003, Christopher Faylor wrote:

> On Wed, Jul 02, 2003 at 07:31:35PM +0200, Corinna Vinschen wrote:
> >On Wed, Jul 02, 2003 at 01:23:13PM -0400, Igor Pechtchanski wrote:
> >> On Wed, 2 Jul 2003, Corinna Vinschen wrote:
> >> > iscygdrive(), defined in, should be sufficient.
> >>
> >> Not quite.  Suppose the user wants to create a symlink to some location on
> >> his /cygdrive/c?  He should be able to do so.  IIRC, there is a difference
> >> in handling EOL's when accessing files through a Win32 path and through
> >> /cygdrive (you can control the binary/text mode of /cygdrive with mount
> >> options).  Do we want to take this away now?
> >
> >That wouldn't happen if the implementation is correct.  Keep in mind that
> >symlink target paths are *always* POSIX paths.  Now we're changing that
> >by just keeping a DOS path as target.  Since we know that it's a path
> >from a symlink, we can savely assume that the path was originally created
> >from the corresponding cygdrive path.  So, the next step when reading that
> >symlink is, revert the DOS path to a cygdrive path.  From now on, the
> >usual binmode/textmode option of that /cygdrive path applies.
> I think there is a disconnect here.  We aren't (or at least I'm not)
> talking about making all symlinks use only windows paths.
> I thought the proposal was to be able to create a special type of symlink
> which contained only a DOS path.  It would be used for setting up things
> which needed to always point to an arbitrary place on an arbitrary disk
> not as a replacement for normal symlink behavior.  This is, I believe, why
> Igor suggested a new symlink option.
> cgf

Yes.  But Corinna's solution would probably work as well, as long as we
are ok with losing the ability to force textmode on symlinks with Win32
paths (if it's there at all, I'm not too clear on that).

For example, now:

ln -s /cygdrive/c/WINNT/system32/drivers/etc/hosts hosts1


ln -s 'c:\WINNT\system32\drivers\etc\hosts' hosts2

will produce two different symlinks.  Will there be a difference in
accessing them (given that /cygdrive is binmode)?  If there is, then
Corinna's solution will disallow the "forced text mode" of the second
link.  Another way of addressing that is to base the mode of symlink
access on the path to the symlink, not the destination path, if it's not
the way it's implemented already.
      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) 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

More information about the Cygwin-developers mailing list