From: nobu.nokada@... Date: 2004-07-04T10:03:21+09:00 Subject: Re: Best way to determine if running on windows or unix-based system Hi, At Sun, 4 Jul 2004 07:23:21 +0900, Carl Youngblood wrote in [ruby-talk:105192]: > 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? It depends on what you want to know. For instance, : file system case File::ALT_SEPARATOR when nil p :unixen when "\\"; p :dosish # mswin32, mingw32, bccwin32, djgpp or human68k ... else # unknown end : fork avaiability begin fork {} true rescue NotImplementedError false end and mounts of different features. What do you want to know about? BTW, what do you mean by "ruby extension"? If you mean an extension library written in C, you definitely don't need DL. You can use HAVE_* macros in config.h. -- Nobu Nakada