os
Interaction with some OS features
Functions
1. os::envList
Returns list of all environment variable names.
Type definition
func(-> list(string))
List of arguments
This function has no parameters
List of results
Name | Type | Description |
---|---|---|
- | list(string) | List of environment variable names |
2. os::exec
Executes external application. Throws string exception if application can not be executed.
Type definition
func(command: string, wait: bool)
List of arguments
Name | Type | Description |
---|---|---|
command | string | Path to executable binary with arguments |
wait | bool | Waits for application to be closed if true |
List of results
This function returns no results
3. os::getEnv
Returns value of environment variable.
Type definition
func(name: string -> string)
List of arguments
Name | Type | Description |
---|---|---|
name | string | Name of variable |
List of results
Name | Type | Description |
---|---|---|
- | string | Returned value of variable |
4. os::lsof
Returns list of handles of files that are open in script.
Type definition
func(-> list(int))
List of arguments
This function has no parameters
List of results
Name | Type | Description |
---|---|---|
- | list(int) | List of handles of open files |
5. os::lsos
Returns list of handles of network TCP or UDP sockets that are opened by program.
Type definition
func(tcp: bool -> list(int))
List of arguments
Name | Type | Description |
---|---|---|
tcp | bool | if true returns TCP sockets othervise UDP sockets are returned |
List of results
Name | Type | Description |
---|---|---|
- | list(int) | List of handles of open sockets |
6. os::pid
Returns current process ID.
Type definition
func(-> int)
List of arguments
This function has no parameters
List of results
Name | Type | Description |
---|---|---|
- | int | Process ID |
7. os::setEnv
Sets environment variable for current program and child processes.
Type definition
func(name: string, value: string)
List of arguments
Name | Type | Description |
---|---|---|
name | string | Name of variable |
value | string | New value of variable |
List of results
This function returns no results
8. os::sleep
Stops program execution for given timeout.
Type definition
func(timeout: int)
List of arguments
Name | Type | Description |
---|---|---|
timeout | int | Milliseconds to wait |
List of results
This function returns no results
9. os::threadId
Returns current thread ID.
Type definition
func(-> int)
List of arguments
This function has no parameters
List of results
Name | Type | Description |
---|---|---|
- | int | Thread ID |
10. os::time
Returns current unix timestamp.
Type definition
func(-> int)
List of arguments
This function has no parameters
List of results
Name | Type | Description |
---|---|---|
- | int | Unix timestamp |