Class Sys::Uname
In: lib/unix/sys/uname.rb
lib/windows/sys/uname.rb
lib/unix/sys/uname.rb
Parent: Object

The Uname class encapsulates information about the system.

Methods

Classes and Modules

Class Sys::Uname::Error
Class Sys::Uname::UnameFFIStruct

Constants

VERSION = '0.9.0'   The version of the sys-uname library
BUFSIZE = 65
BUFSIZE = 32
BUFSIZE = 257
BUFSIZE = 256
CTL_HW = 6
HW_MODEL = 2
SI_SYSNAME = 1
SI_HOSTNAME = 2
SI_RELEASE = 3
SI_VERSION = 4
SI_MACHINE = 5
SI_ARCHITECTURE = 6
SI_HW_SERIAL = 7
SI_HW_PROVIDER = 8
SI_SRPC_DOMAIN = 9
SI_PLATFORM = 513
SI_ISALIST = 514
SI_DHCP_CACHE = 515
UnameStruct = Struct.new("UnameStruct", *fields)
VERSION = '0.9.0'
UnameStruct = Struct.new("UnameStruct", *fields)   The UnameStruct is used to store platform information for some methods.
VERSION = '0.9.0'   The version of the sys-uname library
BUFSIZE = 65
BUFSIZE = 32
BUFSIZE = 257
BUFSIZE = 256
CTL_HW = 6
HW_MODEL = 2
SI_SYSNAME = 1
SI_HOSTNAME = 2
SI_RELEASE = 3
SI_VERSION = 4
SI_MACHINE = 5
SI_ARCHITECTURE = 6
SI_HW_SERIAL = 7
SI_HW_PROVIDER = 8
SI_SRPC_DOMAIN = 9
SI_PLATFORM = 513
SI_ISALIST = 514
SI_DHCP_CACHE = 515
UnameStruct = Struct.new("UnameStruct", *fields)

External Aliases

uname -> uname_c
uname -> uname_c

Public Class methods

The basic instruction set architecture of the current system, e.g. sparc, i386, etc.

The basic instruction set architecture of the current system, e.g. sparc, i386, etc.

The string consisting of the ASCII hexidecimal encoding of the name of the interface configured by boot(1M) followed by the DHCPACK reply from the server.

The string consisting of the ASCII hexidecimal encoding of the name of the interface configured by boot(1M) followed by the DHCPACK reply from the server.

The name of the of the hardware provider.

The name of the of the hardware provider.

The ASCII representation of the hardware-specific serial number of the physical machine on which the function is executed.

The ASCII representation of the hardware-specific serial number of the physical machine on which the function is executed.

The variant instruction set architectures executable on the current system.

The variant instruction set architectures executable on the current system.

Returns the machine hardware type. e.g. "i686".

Returns the machine hardware type.

Example:

 Uname.machine # => 'i686'

Returns the machine hardware type.

Example:

 Uname.machine # => 'i686'

Returns the model type.

Example:

 Uname.model # => 'MacBookPro5,3'

Returns the model type.

Example:

 Uname.model # => 'MacBookPro5,3'

Returns the name of this node within the communications network to which this node is attached, if any. This is often, but not necessarily, the same as the host name.

Example:

 Uname.nodename # => 'your_host.foo.com'

Returns the name of this node within the communications network to which this node is attached, if any. This is often, but not necessarily, the same as the host name.

Example:

 Uname.nodename # => 'your_host.foo.com'

Returns the nodename. This is usually, but not necessarily, the same as the system‘s hostname.

The specific model of the hardware platform, e.g Sun-Blade-1500, etc.

The specific model of the hardware platform, e.g Sun-Blade-1500, etc.

Returns the release number, e.g. 5.1.2600.

Returns the current release level of your operating system.

Example:

 Uname.release # => '2.2.16-3'

Returns the current release level of your operating system.

Example:

 Uname.release # => '2.2.16-3'

The Secure Remote Procedure Call domain name.

The Secure Remote Procedure Call domain name.

Returns the operating system name, e.g. "Microsoft Windows XP Home"

Returns the name of this implementation of the operating system.

Example:

 Uname.sysname # => 'SunOS'

Returns the name of this implementation of the operating system.

Example:

 Uname.sysname # => 'SunOS'

Returns a struct of type UnameStruct that contains sysname, nodename, machine, version, and release, as well as a plethora of other fields. Please see the MSDN documentation for what each of these fields mean.

Returns a struct that contains the sysname, nodename, machine, version and release of your system.

On OS X it will also include the model.

On Solaris, it will also include the architecture and platform.

On HP-UX, it will also include the id_number.

Example:

  require 'sys/uname'

  p Sys::Uname.uname

Returns a struct that contains the sysname, nodename, machine, version and release of your system.

On OS X it will also include the model.

On Solaris, it will also include the architecture and platform.

On HP-UX, it will also include the id_number.

Example:

  require 'sys/uname'

  p Sys::Uname.uname

Returns the current version level of your operating system.

Example:

 Uname.version # => '5.9'

Returns the version plus patch information of the operating system, separated by a hyphen, e.g. "2915-Service Pack 2".

Returns the current version level of your operating system.

Example:

 Uname.version # => '5.9'

[Validate]