From: Wilson Bilkovich Date: 2006-10-25T03:15:23+09:00 Subject: Re: How do I tell when I'm on Cygwin? On 10/24/06, ara.t.howard@noaa.gov wrote: > On Wed, 25 Oct 2006, James Edward Gray II wrote: > > > HighLine has some code like this: > > > > begin > > require "Win32API" > > > > if # I'm looking for the line that goes right here (see below). > > raise LoadError, "On Cygwin, not pure Windows." > > end > > > > # assume we're on Windows here... > > rescue LoadError > > # assume we're on a Posix OS here... > > end > > > > The problem is that Cygwin is using the Windows code and the Posix code would > > be a better choice there. What's a test I can use to detect Cygwin in this > > scenario? > > > > James Edward Gray II > > posix = Process.fork{} and Process.wait rescue nil > Everyone, please remember that Ara is kidding about this. Please do not let this become an idiom. The fact that the Win32 version of Ruby doesn't support fork is a temporary and unfortunate implementation detail, not something you can rely on.