Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <42CFBE28.3060808@byu.net> Date: Sat, 09 Jul 2005 06:08:08 -0600 From: Eric Blake User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Unwanted .exe appended to symlinks References: <1120880636 DOT 6400 DOT 7 DOT camel AT localhost DOT localdomain> <42CF4C9D DOT 8000708 AT byu DOT net> <20050709050214 DOT GA10083 AT trixie DOT casa DOT cgf DOT cx> In-Reply-To: <20050709050214.GA10083@trixie.casa.cgf.cx> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Christopher Faylor on 7/8/2005 11:02 PM: > I don't get it. Certainly /cygdrive/c.exe doesn't exist so why would you > try to link to it? The algorithm I used was this: 1 - If source exists [determined by the return value of readlink ("source"), although just now I realized that for symbolic links, it should really be the return value of readlink (concat (dirname ("dest"), "source")) since symbolic links are relative to the destination, not the pwd] 2a - if source is non-symlink and exists with a trailing . [determined by access ("source.")] use "source", else use "source.exe", because one of those two spellings must have made test 1 succeed 2b - if source is symlink and exists with a trailing .lnk [determined by readlink ("source.lnk")] use "source", else use "source.exe", because one of those two spellings must have made test 1 succeed I think the cleanup needs to be along these lines - in steps 2a and 2b, do a sanity check of also checking whether "source.exe" exists. If neither "source." nor "source.exe" exist, we must be on a virtual/managed drive where the trailing . trick doesn't work, so fall back to "source". "source.exe" should only be chosen when we can prove that "source" doesn't exist but "source.exe" does. - -- Life is short - so eat dessert first! Eric Blake ebb9 AT byu DOT net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCz74n84KuGfSFAYARAkVxAJ9D9nuhSYh7Upg84Ww4n5fIKoGU2ACfX87f QoAcrnJ3i1eOUPMberwA1LY= =vC1h -----END PGP SIGNATURE----- -- 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/