X-Spam-Check-By: sourceware.org Message-ID: <45EA3ABD.4E45BDC5@dessent.net> Date: Sat, 03 Mar 2007 19:19:25 -0800 From: Brian Dessent X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: very odd behavior of Cygwin python from CMD References: <87d53qhxk4 DOT fsf AT valverde DOT peloton> <877itxiu6k DOT fsf AT valverde DOT peloton> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 David Abrahams wrote: > Now, I am writing a program that must use CMD to probe for python in > the PATH and check its version. If I do the naive thing and just try > to invoke "python," and there's a Cygwin installation, my program will > crash or freeze. So the question is, what do I do instead? One way to handle this would be to check if the thing found in the path looks like a symlink (say, by having a size less than a hundred bytes and the 'S' attribute set) and if so, launch it as "sh.exe -c python", using sh.exe in the same dir as the shortcut. This will invoke python through the shell, which will follow symlinks. Non-cygwin programs will have no idea what a symlink is. Brian -- 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/