module system.tf
The tweakstreet/system
module provides information about the operating system and runtime environment.
library system
The system library provides information about the runtime environment.
platform
string
Identifies the operating system platform. The following values are most common:
"windows"
"linux"
"mac"
In addition, the following values are possible:
"free_bsd"
"net_bsd"
"open_bsd"
"solaris"
"sun_os"
"aix"
"hp-ux"
"os/400"
"z/os"
"os/2"
"irix"
"unix"
"unknown"
> system.platform
"mac"
environment
dict
The environment variables of the current process, indexed by name. All values in the dict are strings.
> system.environment
{
:TERM "xterm-256color",
:LANG "en_GB.UTF-8",
:TMPDIR "/var/folders/3t/mqc70f_54xs9h_xp6t1dhscw0000gn/T/",
:PWD "/Users/username/tweakstreet-app",
:PATH "/usr/local/bin:/Users/username/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:Users/username/bin",
:USER "username",
:LOGNAME "username",
:SHELL "/bin/bash",
:HOME "/Users/username"
...
}
file_separator
string
The file separator used by the system.
This is typically '\'
for windows systems, and '/'
for all other systems.
> system.file_separator
"/"
line_separator
string
The line separator used by the system.
This is "\r\n"
for windows systems, and "\n"
for all other systems.
> "Hello"..system.line_separator.."World!"
"Hello
World!"
tmp_dir
string
The effective temporary directory as indicated by the operating system.
> system.tmp_dir
"/var/folders/3t/mqc70f_54xs9h_xp6t1dhscw0000gn/T/"
library os
The os library provides information about operating system details.
name
string
The name of the operating system.
> os.name
"Mac OS X"
version
string
The version of the operating system.
> os.version
"10.14.6"
arch
string
The architecture of the operating system.
> os.arch
"x86_64"
platform
string
The platform of the operating system. Identical to system.platform
> os.platform
"mac"
is_mac
boolean
true
if the system platform is Mac OS, false
otherwise
> os.is_mac
true
is_linux
boolean
true
if the system platform is Linux, false
otherwise
> os.is_linux
false
is_windows
boolean
true
if the system platform is Windows, false
otherwise
> os.is_windows
false