Available on cs, php, neko, cpp, macro, java, lua, python, hl
new(cmd:String, ?args:Array<String>, ?detached:Bool)
Process object, which run the given command immediately.
Command arguments can be passed in two ways: 1. using
args, 2. appending to
cmd and leaving
args to pass command arguments, each argument will be automatically quoted, and shell meta-characters will be escaped if needed.
cmd should be an executable name that can be located in the
PATH environment variable, or a path to an executable.
args is not given or is
null, command arguments can be appended to
cmd. No automatic quoting/escaping will be performed.
cmd should 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:
detached allows the created process to be standalone. You cannot communicate with it but you can look at its exit code. Not supported on php.
close() should be called when the
Process is no longer used.
Standard error. The output stream to output error messages or diagnostics.
Standard input. The stream data going into a process.
Standard output. The output stream where a process writes its output data.
Close the process handle and release the associated resources. All
Process fields should not be used after
close() is called.
exitCode(block:Bool = true):Null<Int>
Query the exit code of the process. If
block is true or not specified, it will block until the process terminates. If
block is false, it will return either the process exit code if it's already terminated or null if it's still running. If the process has already exited, return the exit code immediately.
Return the process ID.
Kill the process.
© 2005–2020 Haxe Foundation
Licensed under a MIT license.