Alexander Fleck wrote:
> Hi,
> what' s the best way to detect if I' m on a windows or linux machine.


As a quick and nasty hack for domestic use, consider one of these two
(depending on taste):

  NIX = File.exist?('/dev/null') and !File.exist?('/NUL')
  p [:NIX, NIX, RUBY_PLATFORM]  # [:NIX, false, "i586-bccwin32"]

# -OR-

  WIN = File.exist?('/NUL') and !File.exist?('/dev/null')
  p [:WIN, WIN, RUBY_PLATFORM]  # [:WIN, true, "i586-bccwin32"]


# Maybe both (for some solidity), adding:

  NIX != WIN or raise 'Unrecognised platform'

?

daz