This class gives you access to many base functionalities of system platforms. Looks in
sys sub packages for more system APIs.
Run the given command. 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).
Command arguments can be passed in two ways: 1. using
args, 2. appending to
cmd and leaving
argsto pass command arguments, each argument will be automatically quoted, and shell meta-characters will be escaped if needed.
cmdshould be an executable name that can be located in the
PATHenvironment variable, or a path to an executable.
argsis not given or is
null, command arguments can be appended to
cmd. No automatic quoting/escaping will be performed.
cmdshould be formatted exactly as it would be when typed at the command line. It can run executables, as well as shell commands that are not executables (e.g. on Windows:
sys.io.Process api for a more complete way to start background processes.
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.
Returns the path to the current executable that we are running.
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.
Get the current working directory (usually the one in which the program was started)
Returns the absolute path to the current program file that we are running. Concretely, for an executable binary, it returns the path to the binary. For a script (e.g. a PHP file), it returns the path to the script.
Change the current time locale, which will affect
DateTools.format date formating.
Returns true if the locale was successfully changed
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.
Returns the name of the system you are running on. For instance : "Windows", "Linux", "BSD" and "Mac" depending on your desktop OS.