This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: programming API to determine whether in "Cygwin environment"
- From: "Karr, David" <david dot karr at wamu dot net>
- To: "Tony Last" <misc at boyski dot com>, <cygwin at cygwin dot com>
- Date: Fri, 11 Jul 2008 08:34:17 -0700
- Subject: RE: programming API to determine whether in "Cygwin environment"
- References: <18395872.post@talk.nabble.com>
The "ant" shell script checks to see if "`uname`" contains the string
"CYGWIN".
> -----Original Message-----
> From: cygwin-owner@cygwin.com
> [mailto:cygwin-owner@cygwin.com] On Behalf Of Tony Last
> Sent: Thursday, July 10, 2008 8:49 PM
> To: cygwin@cygwin.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/