This class gives you access to many base functionalities of system platforms. Looks in [sys] sub packages for more system APIs.

Static variables

staticargs:Void ‑> Array<String>

Available on Flash, HTML5

Returns all the arguments that were passed by the commandline.

staticcommand:String ‑> Array<String> ‑> Int

Available on Flash, HTML5

Run the given command with the list of arguments. The command output will be printed on the same output as the current process. The current process will block until the command terminates and it will return the command result (0 if there was no error). Read the [sys.io.Process] api for a more complete way to start background processes.

staticcpuTime:Void ‑> Float

Available on Flash, HTML5

Gives the most precise timestamp value (in seconds) but only account for the actual time spent running on the CPU for the current thread/process.

staticenvironment:Void ‑> Map<String, String>

Available on Flash, HTML5

Returns the whole environement variables.

staticexecutablePath:Void ‑> String

Available on Flash, HTML5

Returns the path to the current executable that we are running.

staticexit:Int ‑> Void

Available on Flash, HTML5

Exit the current process with the given error code.

staticgetChar:Bool ‑> Int

Available on Flash, HTML5

Read a single input character from the standard input (without blocking) and returns it. Setting [echo] to true will also display it on the output.

staticgetCwd:Void ‑> String

Available on Flash, HTML5

Get the current working directory (usually the one in which the program was started)

staticgetEnv:String ‑> String

Available on Flash, HTML5

Returns the value of the given environment variable.

staticprint:Dynamic ‑> Void

Available on Flash, HTML5

Print any value on the standard output.

staticprintln:Dynamic ‑> Void

Available on Flash, HTML5

Print any value on the standard output, followed by a newline

staticputEnv:String ‑> String ‑> Void

Available on Flash, HTML5

Set the value of the given environment variable.

staticsetCwd:String ‑> Void

Available on Flash, HTML5

Change the current working directory.

staticsetTimeLocale:String ‑> Bool

Available on Flash, HTML5

Change the current time locale, which will affect [DateTools.format] date formating. Returns true if the locale was successfully changed

staticsleep:Float ‑> Void

Available on Flash, HTML5

Suspend the current execution for the given time (in seconds).

staticstderr:Void ‑> Output

Available on Flash, HTML5

Returns the process standard error on which you can write.

staticstdin:Void ‑> Input

Available on Flash, HTML5

Returns the process standard input, from which you can read what user enters. Usually it will block until the user send a full input line. See [getChar] for an alternative.

staticstdout:Void ‑> Output

Available on Flash, HTML5

Returns the process standard output on which you can write.

staticsystemName:Void ‑> String

Available on Flash, HTML5

Returns the name of the system you are running on. For instance : "Windows", "Linux", "BSD" and "Mac" depending on your desktop OS.

statictime:Void ‑> Float

Available on Flash, HTML5

Gives the most precise timestamp value (in seconds).

Static methods

staticargs ():Array<String>

Available on Linux, Android, Windows, iOS, Neko, macOS

Returns all the arguments that were passed by the commandline.

staticcommand (cmd:String, ?args:Array<String>):Int

Available on Linux, Windows, Neko, macOS

Run the given command with the list of arguments. The command output will be printed on the same output as the current process. The current process will block until the command terminates and it will return the command result (0 if there was no error). Read the [sys.io.Process] api for a more complete way to start background processes.

staticenvironment ():Map<String, String>

Available on Linux, Windows, Neko, macOS

Returns the whole environement variables.

staticexit (code:Int):Void

Available on Linux, Android, Windows, iOS, Neko, macOS

Exit the current process with the given error code.

staticgetChar (echo:Bool):Int

Available on Linux, Windows, Neko, macOS

Read a single input character from the standard input (without blocking) and returns it. Setting [echo] to true will also display it on the output.

staticgetCwd ():String

Available on Linux, Windows, Neko, macOS

Get the current working directory (usually the one in which the program was started)

staticgetEnv (s:String):String

Available on Linux, Windows, Neko, macOS

Returns the value of the given environment variable.

staticprint (v:Dynamic):Void

Available on Linux, Android, Windows, iOS, Neko, macOS

Print any value on the standard output.

staticprintln (v:Dynamic):Void

Available on Linux, Android, Windows, iOS, Neko, macOS

Print any value on the standard output, followed by a newline

staticputEnv (s:String, v:String):Void

Available on Linux, Windows, Neko, macOS

Set the value of the given environment variable.

staticsetCwd (s:String):Void

Available on Linux, Windows, Neko, macOS

Change the current working directory.

staticsleep (seconds:Float):Void

Available on Linux, Android, Windows, iOS, Neko, macOS

Suspend the current execution for the given time (in seconds).

staticstderr ():Output

Available on Linux, Windows, Neko, macOS

Returns the process standard error on which you can write.

staticstdin ():Input

Available on Linux, Windows, Neko, macOS

Returns the process standard input, from which you can read what user enters. Usually it will block until the user send a full input line. See [getChar] for an alternative.

staticsystemName ():String

Available on Linux, Windows, Neko, macOS

Returns the name of the system you are running on. For instance : "Windows", "Linux", "BSD" and "Mac" depending on your desktop OS.