Skip to content

sys

The sys module exposes basic information and types associated with systems and platforms supported by Do.

Types

Type Description
OsInfo Operating system target information
CpuInfo CPU target information
ErrorCode Native system error code
Error Error raised for system and I/O failures
NotFoundError Subtype for missing files, paths, or programs
PermissionDeniedError Subtype for permission failures
AlreadyExistsError Subtype for existing-path conflicts
TimedOutError Subtype for timed-out system operations
UnsupportedError Subtype for unsupported system operations

Functions

os_info()

Returns operating system information for the current VFS target.

if (sys.os_info().family == :WINDOWS:)
  echo "running on Windows"

cpu_info()

Returns CPU information for the current VFS target.

let info = sys.cpu_info()
echo "running on $info.arch with $info.logical_count logical CPUs"