[Mono-devel-list] Platform identification
Gaurav Vaish
gvaish at adobe.com
Fri Nov 21 07:28:27 EST 2003
On windows, you have environment variable "OS" set.
On WinNT and 2k, it's "Windows_NT",
On Mac, you have "OSTYPE" set as "darwin" (for OS X)
On Linux as well, you have OSTYPE set, so it is on Cygwin.
You may be interested in exploring these options...
Cheers,
Gaurav
http://gallery.mastergaurav.net/
----- Original Message -----
From: "Aleksey Demakov" <avd at openlinksw.com>
To: <mono-devel-list at lists.ximian.com>
Sent: Friday, November 21, 2003 16:59
Subject: [Mono-devel-list] Platform identification
> Hi all,
>
> With a recent update of Mono I've run into a problem with platform
> identification. My code relied upon PlatformID.Unix for this
> puporse. Now PlatformID.Unix no longer exists so my code no longer
> works. Actually my method of platform identification has always
> been a kludge so I don't complain about it. But if I start using
> another kludge that works now I'm not sure how much time it will
> stay working. I don't want to deal with this problem over and over
> again.
>
> So could we introduce an official method of platform identification
> that will remain working and supported all the time?
>
> I'd suggest to add somewhere, e.g. to System.Environment or some new
> class two properties:
>
> static String PlatformName {get;} // Returns OS name in the
> // style of uname.
> static String RuntimeName {get;} // Returns "Mono".
>
> I think the use of strings instead of enums is much more flexible
> since there is no need to change the type definition every time
> Mono is ported to another platform. The idea behind RuntimeName is
> to convince other people like DotGnu or even ECMA to use this
> approach as well.
>
> Regards,
> Aleksey
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
More information about the Mono-devel-list
mailing list