Module : system

Version : 0.6.0

Module overview

This module provides functions to retrieve information about the system and the current users of the system. The system:exec method creates the system:Process object, which can control and obtain information about a Ballerina process.

For information on the operations, which you can perform with the system module, see the below Functions.

Objects

Process

This object contains information on a process being created from Ballerina. This is returned from the exec function in the system module.

Functions

exec

Executes an operating system command as a subprocess of the current process.

getEnv

Returns the environment variable value associated with the provided name.

getUserHome

Returns the current user's home directory path.

getUsername

Returns the current user's name.

uuid

Returns a random UUID string.

Types

Error

The union of all the System related errors.

Errors

FileNotFoundError

Represents a FileNotFoundError with the message and the cause.

FileSystemError

Represents a FileSystemError with the message and the cause.

InvalidOperationError

Represents an InvalidOperationError with the message and the cause.

PermissionError

Represents a PermissionError with the message and the cause.

ProcessExecError

Represents an ProcessExecError with the message and the cause.