delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/07/11/11:36:09

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: RE: programming API to determine whether in "Cygwin environment"
Date: Fri, 11 Jul 2008 08:34:17 -0700
Message-ID: <0C260F619E428642BFA6380177C3ADF3067B484B@exmsea005.us.wamu.net>
In-Reply-To: <18395872.post@talk.nabble.com>
References: <18395872 DOT post AT talk DOT nabble DOT com>
From: "Karr, David" <david DOT karr AT wamu DOT net>
To: "Tony Last" <misc AT boyski DOT com>, <cygwin AT cygwin DOT com>
X-CFilter: Pass
X-CFilter: Pass
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m6BFa7iu028934

The "ant" shell script checks to see if "`uname`" contains the string
"CYGWIN". 

> -----Original Message-----
> From: cygwin-owner AT cygwin DOT com 
> [mailto:cygwin-owner AT cygwin DOT com] On Behalf Of Tony Last
> Sent: Thursday, July 10, 2008 8:49 PM
> To: cygwin AT cygwin DOT com
> Subject: programming API to determine whether in "Cygwin environment"
> 
> 
> My console program is built for native Windows (thus does not 
> reply on cygwin1.dll). However, people may want to use it in 
> a Cygwin environment and if they do I want it to behave in a 
> suitably "Unixy" way. The obvious example is that when it 
> prints out a pathname (which happens a lot) a Cygwin user 
> would prefer to see it in Cygwin style, including forward slashes.
> 
> So I'm looking for a boolean method which will allow a 
> program to tell whether it was run from within a Cygwin 
> shell. An environment variable would be fine as long as it's 
> standard. In fact I see a number of env vars which would 
> enable an educated guess but am wondering if there's a 
> defined standard and safe way.
> 
> TIA
> --
> View this message in context: 
> http://www.nabble.com/programming-API-to-determine-whether-in-
%22Cygwin-environment%22-tp18395872p18395872.html
> Sent from the Cygwin list mailing list archive at Nabble.com.
> 
> 
> --
> 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/
> 
> 

--
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/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019