This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
RE: New symlinks.
- To: 'Bjoern Kahl AG Resy' <kahl at informatik dot uni-kl dot de>, Cygwin <cygwin at cygwin dot com>
- Subject: RE: New symlinks.
- From: Bernard Dautrevaux <Dautrevaux at microprocess dot com>
- Date: Wed, 28 Feb 2001 11:41:56 +0100
> -----Original Message-----
> From: Bjoern Kahl AG Resy [mailto:kahl@informatik.uni-kl.de]
> Sent: Tuesday, February 27, 2001 8:07 PM
> To: Cygwin
> Subject: Re: New symlinks.
<skipped>
>
> In short:
>
> Let existing Win-name be "foo.lnk":
>
> posix-
> name | valid shortcut | not shortcut
> -------+----------------+-----------------
> foo | process as | ENOENT
> | symlink |
> -------+----------------+-----------------
> foo.lnk| ENOENT | return fileinfo/
> | | filehandle
>
That seems OK.
> Let existing Win-name be "foo":
>
> posix-
> name | valid shortcut | not shortcut
> -------+----------------+-----------------
> foo | process as | return fileinfo/
> | symlink | filehandle
> -------+----------------+-----------------
> foo.lnk| ENOENT | ENOENT
> | |
>
I'm not sure if processing win-file "foo" as symlink is interesting; I don't
even think it will be recognized as a shortcut by Windows
Umhh... checking...
Yeah, if I rename xxx.exe.lnk (a link to xxx.exe) to be yyy.exe, then
Windows (at least explorer) think it's an executable, no more a shortcut,
but can't execute it (as it's not a valid PE file)...
So the correct behavious if WinFile "foo" is a valid shortcut is to access
the shortcut file, not the linked-to file.
>
> There is no existing file with Win-name "foo" or "foo.lnk":
>
> Process as usual e.g. return ENOENT or create file of given
> name and extension
Probably yes, although creating a "foo.lnk" file is dubious.
>
> (I hope, I do not mixed things here ...)
>
> Problem:
> What to do, if there is both: a file with Win-Name "foo and
> a file with Win-Name "foo.lnk" ?
>
> If none of it is a valid shortcut, then that is no problem at all.
> both are stat() and open() able.
OK, seems sensible
>
> If "foo.lnk" is a valid shortcut, then I would say the real
> file "foo" should win. That is, the shortcut would be invisible.
That is IMHO the only consistent behaviour; together with cygwin refusing to
create a link named foo (that is a WinFile named foo.lnk) if foo already
exists (sorry Corinna, it's perhaps already done this way but I can't
check). Cygwin should also refuse creating a file named foo if a link named
foo (that is a WinFile named foo.lnk which is a valid shortcut) already
exist.
The only remaining problem would be if files/shortcuts are created from
Windows-native programs, but we shouldn't bother too much about that: after
all people in this world are used to see a file "named" foo being in fact
"foo.lnk" (with a shortcut icon) and another one also "named" foo but having
another icon ;^). Don't underestimate people using Windows; most of them are
not idiots and are used to Windows idiosyncrasisms, so when using cygwin
they can adapt :-)
> This is consistent with Unix, where you cant have a file and a
> symlink of the same name in one directory.
Which UNIX ? version/revision ? so that I know which one is broken so much
;-)
>
>
> Bjoern
Regards,
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?
Check out: http://cygwin.com/ml/#unsubscribe-simple