ballerina/os

Overview

This module provides APIs to retrieve information about the environment variables and the current users of the Operating System.

The APIs are platform-independent, i.e., uniform across all operating systems.

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

Functions

[6]

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.

listEnv

Returns a map of environment variables.

setEnv

Sets the value of the environment variable named by the key.

unsetEnv

Removes a single environment variable from the system if it exists.

Errors

[1]

Error

Represents OS module related errors.