On this page:
system.version
system.racket_  version
system.type
system.os
system.arch
system.word
system.host
system.target_  machine
system.Target  Machine  Symbol
system.path
system.so_  suffix
system.locale_  string_  encoding
system.language_  and_  country
system.seconds
system.milliseconds
system.exit
0.45+9.2.0.2

14.7 System Information and Control🔗ℹ

Reports the running Rhombus version.

See rhombus/version for version-number conversion and comparison utilities.

> system.version()

"0.45"

Reports the host Racket version.

See rhombus/version for version-number conversion and comparison utilities.

> system.racket_version()

"9.2.0.2"

function

fun system.type() :: Symbol

Report the host platform’s general type: #'unix, #'windows, or #'macosx.

function

fun system.os() :: Symbol

Report the host platform’s operating system more specifically than system.type. For example, the result may be #'linux or #'freebsd instead of #'unix.

function

fun system.arch() :: Symbol

Report the host platform’s architecture. Possible results include #'x86_64, #'i386, #'aarch64, #'arm (32-bit), and #'ppc (32-bit).

function

fun system.word() :: Int

Report the word size in bits for the host platform’s architecture. Possible results currently are 32 and 64.

function

fun system.host() :: String

Reports details of the host operating system in a platform-specific format.

Reports the native compilation target machine for the host platform. Possible results include #'ta6le, #'tarm64osx, and #'ti3nt.

The system.TargetMachineSymbol annotation is satisfied by a machine type symbol that are supported as a compilation target by the host Racket system, which may include a cross-compilation target machine.

function

fun system.path(which :: Symbol) :: Path

Returns a system-specific path categorized by which:

  • #'temp_dir: a path to a directory for storing temporary files.

Reports a file suffix conventionally used by the host operating system for shared objects, also known as dynamically linked libraries. Possible results include #".so", #".dll", and #".dylib".

A string for the current locale’s encoding. This string is suitable for use as an encoding name with bytes.Converter.

A string to identify the current user’s language and country.

On Unix and Mac OS, the string is five characters: two lowercase ASCII letters for the language, an underscore, and two uppercase ASCII letters for the country. On Windows, the string can be arbitrarily long, but the language and country are in English (all ASCII letters or spaces) separated by an underscore.

On Unix, the result is determined by checking the LC_ALL, LC_TYPE, and LANG environment variables, in that order (and the result is used if the environment variable’s value starts with two lowercase ASCII letters, an underscore, and two uppercase ASCII letters, followed by either nothing or a period). On Windows and Mac OS, the result is determined by system calls.

The system.seconds reports the current time in seconds since the epoch, January 1, 1970 UTC, which is consistent with the filesystem.modify_seconds function’s result, for example. The system.milliseconds function reports the same time with more precision, expressed in milliseconds (including fractional milliseconds) since the epoch.

See also measure.cpu_milliseconds and measure.real_milliseconds.

function

fun system.exit(v :: Any = #true) :: Void

Calls the system exit handler, which normally exits the current process. If v is a byte, then the byte is used as the process’s exit code, otherwise 0 is used as the exit code.