X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: <45387.97.113.116.104.1215754377.squirrel@webmail.efn.org> In-Reply-To: <20080711050615.GA4181@ednor.casa.cgf.cx> References: <18395872 DOT post AT talk DOT nabble DOT com> <20080711050615 DOT GA4181 AT ednor DOT casa DOT cgf DOT cx> Date: Thu, 10 Jul 2008 22:32:57 -0700 (PDT) Subject: Re: programming API to determine whether in 'Cygwin environment' From: "Yitzchak Scott-Thoennes" To: cygwin AT cygwin DOT com User-Agent: SquirrelMail/1.5.1 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On Thu, July 10, 2008 10:06 pm, Christopher Faylor wrote: > On Thu, Jul 10, 2008 at 08:49:06PM -0700, Tony Last wrote: >> My console program is built for native Windows (thus does not reply on >> cygwin1.dll). >> >> So I'm looking for a boolean method which will allow a program to tell >> whether it was run from within a Cygwin shell. > > A PATH containing colons which weren't preceded by just a single > alphabetic character would be a clue but it wouldn't be foolproof. A HOME > environment variable with no colons and forward slashes would be another > clue. I don't think there is a foolproof test, though. Both HOME and PATH are translated by the time the non-cygwin program sees them, though?? -- 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/