Header menu logo B2R2

OS Module

Provides functions to work with OS types.

Functions and values

Function or value Description

OS.isRunnable progName

Full Usage: OS.isRunnable progName

Parameters:
    progName : string - The program name or path to check.

Returns: bool true if the program exists at the given path or is found in PATH; otherwise false.

Checks if the given program name is runnable in the current environment by searching the PATH environment variable.

progName : string

The program name or path to check.

Returns: bool

true if the program exists at the given path or is found in PATH; otherwise false.

OS.ofString s

Full Usage: OS.ofString s

Parameters:
    s : string - A string representing the OS type.

Returns: OS An OS value corresponding to s.

Gets an OS value from a string. Accepts "windows" or "win", "linux", "macos"/"macosx"/"mac"/"osx", or "unknown" (case-insensitive). Raises UnknownOSException if the string is not recognized.

s : string

A string representing the OS type.

Returns: OS

An OS value corresponding to s.

OS.toString os

Full Usage: OS.toString os

Parameters:
    os : OS - The OS value to convert.

Returns: string "Windows", "Linux", "Mac", or "UnknownOS".

Gets the string representation of the given OS value. Raises UnknownOSException for invalid values.

os : OS

The OS value to convert.

Returns: string

"Windows", "Linux", "Mac", or "UnknownOS".

Type something to start searching.