зеркало из https://github.com/mono/mail-archives.git
90 строки
3.6 KiB
HTML
90 строки
3.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
||
<HTML>
|
||
<HEAD>
|
||
<TITLE> [Mono-list] Determining the platform at compile and run time
|
||
</TITLE>
|
||
<LINK REL="Index" HREF="index.html" >
|
||
<LINK REL="made" HREF="mailto:rafaelteixeirabr%40hotmail.com">
|
||
<META NAME="robots" CONTENT="index,nofollow">
|
||
|
||
<LINK REL="Previous" HREF="016670.html">
|
||
<LINK REL="Next" HREF="016672.html">
|
||
</HEAD>
|
||
<BODY BGCOLOR="#ffffff">
|
||
<H1>[Mono-list] Determining the platform at compile and run time
|
||
</H1>
|
||
<B>A Rafael D Teixeira
|
||
</B>
|
||
<A HREF="mailto:rafaelteixeirabr%40hotmail.com"
|
||
TITLE="[Mono-list] Determining the platform at compile and run time">rafaelteixeirabr@hotmail.com
|
||
</A><BR>
|
||
<I>Fri, 31 Oct 2003 05:23:13 -0200</I>
|
||
<P><UL>
|
||
<LI> Previous message: <A HREF="016670.html">[Mono-list] Compiling PocketPC .NET binaries with Mono
|
||
</A></li>
|
||
<LI> Next message: <A HREF="016672.html">[Mono-list] Determining the platform at compile and run time
|
||
</A></li>
|
||
<LI> <B>Messages sorted by:</B>
|
||
<a href="date.html#16671">[ date ]</a>
|
||
<a href="thread.html#16671">[ thread ]</a>
|
||
<a href="subject.html#16671">[ subject ]</a>
|
||
<a href="author.html#16671">[ author ]</a>
|
||
</LI>
|
||
</UL>
|
||
<HR>
|
||
<!--beginarticle-->
|
||
<PRE>><i>From: Fergus Henderson <<A HREF="mailto:fjh@cs.mu.OZ.AU">fjh@cs.mu.OZ.AU</A>>
|
||
</I>><i>
|
||
</I>><i>On 29-Oct-2003, Chris Seaton <<A HREF="mailto:chris@chrisseaton.com">chris@chrisseaton.com</A>> wrote:
|
||
</I>><i> > How do I know what OS my program is running on at run time?
|
||
</I>><i>
|
||
</I>><i>Why do you care?
|
||
</I>><i>
|
||
</I>><i>In general, it is a bad idea to test for particular operating systems.
|
||
</I>
|
||
In my case I needed to know which specific library to load and use. Because
|
||
the Windows version needed to PInvoke in the Win32 API (calling
|
||
FlushFileBuffers on an Stream handle), and the Mono one would have to make
|
||
an InternalCall (that would fsync the emulated Stream handle). Those things
|
||
were in a single piece of software before and would play havoc when
|
||
loaded/executed in the wrong CLI., what was always.
|
||
|
||
I used a modified PlugIn Pattern [Fowler - PoEAA], to make it transparent
|
||
for the Bamboo.Prevalence user, and without conditionally compiling two
|
||
different versions of the package.
|
||
|
||
I could use your try/catch solution, but I prefer to use "decisions
|
||
construed over known information" than "try/catch" for performance reasons.
|
||
|
||
Best regards,
|
||
|
||
Rafael Teixeira
|
||
Brazilian Polymath
|
||
Mono Hacker since 16 Jul 2001
|
||
MonoBrasil Founder
|
||
English Blog: <A HREF="http://monoblog.blogspot.com/">http://monoblog.blogspot.com/</A>
|
||
Brazilian Portuguese Blog: <A HREF="http://monoblog.weblogger.terra.com.br/">http://monoblog.weblogger.terra.com.br/</A>
|
||
|
||
_________________________________________________________________
|
||
MSN Messenger: instale gr<67>tis e converse com seus amigos.
|
||
<A HREF="http://messenger.msn.com.br">http://messenger.msn.com.br</A>
|
||
|
||
|
||
</PRE>
|
||
<!--endarticle-->
|
||
<HR>
|
||
<P><UL>
|
||
<!--threads-->
|
||
<LI> Previous message: <A HREF="016670.html">[Mono-list] Compiling PocketPC .NET binaries with Mono
|
||
</A></li>
|
||
<LI> Next message: <A HREF="016672.html">[Mono-list] Determining the platform at compile and run time
|
||
</A></li>
|
||
<LI> <B>Messages sorted by:</B>
|
||
<a href="date.html#16671">[ date ]</a>
|
||
<a href="thread.html#16671">[ thread ]</a>
|
||
<a href="subject.html#16671">[ subject ]</a>
|
||
<a href="author.html#16671">[ author ]</a>
|
||
</LI>
|
||
</UL>
|
||
</body></html>
|