OS version

I have written a module called Sys::Uname that does this. It’s an extension
based on the uname command, and it’s available on the RAA. Your other
alternative is to use the output of a system call.

The above applies to *nix only. I don’t how to do it in Windows.

Regards,

Dan

···

-----Original Message-----
From: Kontra, Gergely [mailto:kgergely@mlabdial.hit.bme.hu]

Hi!

Is there a way to find out the OS version from ruby?

thx
Gergo

From: Kontra, Gergely [mailto:kgergely@mlabdial.hit.bme.hu]
Is there a way to find out the OS version from ruby?

I have written a module called Sys::Uname that does this. It’s an
extension
based on the uname command, and it’s available on the RAA. Your other
alternative is to use the output of a system call.

The above applies to *nix only. I don’t how to do it in Windows.

One way is:

winos = ver

That variable is supposed to be
"win OS" not the plural of wino.

Hal

···

----- Original Message -----
From: “Berger, Daniel” djberge@qwest.com
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Wednesday, August 21, 2002 11:14 AM
Subject: RE: OS version

-----Original Message-----

Is there a way to find out the OS version from ruby?
The above applies to *nix only. I don’t how to do it in Windows.
Well, the only thing I need it for is to detect windows :slight_smile:

Gergo

±[Kontra, Gergely @ Budapest University of Technology and Economics]-+

    Email: kgergely@mcl.hu,  kgergely@turul.eet.bme.hu          |

URL: turul.eet.bme.hu/~kgergely Mobile: (+36 20) 356 9656 |
±------“Olyan langesz vagyok, hogy poroltoval kellene jarnom!”-------+
.
Magyar php mirror es magyar php dokumentacio: http://hu.php.net

You could test for ENV[“windir”] or ENV[“COMSPEC”] on Win98, at least.

Not sure about WinNT or Win2K.

– Dossy

···

On 2002.08.22, Kontra, Gergely kgergely@mlabdial.hit.bme.hu wrote:

Is there a way to find out the OS version from ruby?
The above applies to *nix only. I don’t how to do it in Windows.
Well, the only thing I need it for is to detect windows :slight_smile:


Dossy Shiobara mail: dossy@panoptic.com
Panoptic Computer Network web: http://www.panoptic.com/
“He realized the fastest way to change is to laugh at your own
folly – then you can let go and quickly move on.” (p. 70)