This API documentation is for Ballerina 1.2.0. View API documentation for the latest release.

Module : system

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.

Records

Detail

Record type to hold the details of an error.

Objects

Process

This object contains information on a process being created from Ballerina.

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.

Constants

INVALID_OPERATION_ERROR

Represents the error code for invalid operations.

PERMISSION_ERROR

Represents the error code for permission errors.

FILE_SYSTEM_ERROR

Represents the error code for file system errors.

FILE_NOT_FOUND_ERROR

Represents the error code for file not found.

Types

Error

Represents System related errors.

Errors

FileNotFoundError

Represents a FileNotFoundError with a detailed message.

FileSystemError

Represents a FileSystemError with a detailed message.

InvalidOperationError

Represents an InvalidOperationError with a detailed message.

PermissionError

Represents a PermissionError with a detailed message.