Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <17B78BDF120BD411B70100500422FC6309E21C@IIS000> From: Bernard Dautrevaux To: "'Bjoern Kahl AG Resy'" , Cygwin Subject: RE: New symlinks. Date: Wed, 28 Feb 2001 11:41:56 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" > -----Original Message----- > From: Bjoern Kahl AG Resy [mailto:kahl AT informatik DOT uni-kl DOT de] > Sent: Tuesday, February 27, 2001 8:07 PM > To: Cygwin > Subject: Re: New symlinks. > > 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 AT microprocess DOT com b DOT dautrevaux AT usa DOT net -------------------------------------------- -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple