From: Erik Veenstra Date: 2004-07-04T07:52:44+09:00 Subject: Re: Best way to determine if running on windows or unix-based system On Sun, 04 Jul 2004 07:23:21 +0900, Carl Youngblood wrote: > I'm going to try using Ruby/DL to write a full-fledged ruby > extension for the curl library. I'd like it to work on both > Windows and Unix-based systems. I'm sure there are a lot of > ways of doing this, but what do you guys think is the best > way to determine whether your script is being called on a > windows-based system or a unix-based system? require "rbconfig" def linux? not windows? and not cygwin? end def windows? not (target_os.downcase =~ /32/).nil? end def cygwin? not (target_os.downcase =~ /cyg/).nil? end def target_os Config::CONFIG["target_os"] or "" end gegroet, Erik V.