Image Uploader Scripting API: Process Class Reference

| Image Uploader Scripting API

Public Member Functions | List of all members
Process Class Reference

The Process class is used to start external programs and to communicate with them.
More...

`#include <Process.h>`

## Public Member Functions

| Process ()
| Process (string executable)
| Process (string executable, bool findInPath)
string | findExecutableInPath (string executable)
bool | launchInShell (string command)
| Launches a shell-based command. More...
string | readOutput ()
| setArguments (array arguments)
| setCaptureOutput (bool read)
| setExecutable (string program)
| setHidden (bool hidden)
| setOutputEncoding (string encoding)
bool | start ()
int | waitForExit ()

## Detailed Description

The Process class is used to start external programs and to communicate with them.

Since
  version 1.3.2

## Constructor Destructor Documentation

## ◆ Process() [1/3]

Process | ( |  | ) |

Default empty constructor

## ◆ Process() [2/3]

Process | ( | string | executable | ) |

Constructor which takes executable name (should be absolute or relative path)

## ◆ Process() [3/3]

Process | ( | string | executable,
|  | bool | findInPath
| ) |  |

Parameters

  findInPath | if true, executable is being searched in directories listed in PATH environment variable

## Member Function Documentation

## ◆ launchInShell()

bool launchInShell | ( | string | command | ) |

Launches a shell-based command.

Executes the given command through the default system shell. The command is subject to pattern expansion, redirection and pipelining.

This function behaves similarly to the system(3) system call. In a POSIX system, the command is fed to /bin/sh whereas under a Windows system, it is fed to cmd.exe. It is difficult to write portable commands as the first parameter, but this function comes in handy in multiple situations.

## ◆ setHidden()

setHidden | ( | bool | hidden | ) |

If set to true, process window is hidden (Windows only)

## ◆ setOutputEncoding()

setOutputEncoding | ( | string | encoding | ) |

Set the encoding of process output stream. By default, CP_OEMCP is used on Windows and current locale on other systems. (UTF-8 on most of modern UNIX-bases systems)

## ◆ waitForExit()

int waitForExit | ( |  | ) |

Wait indefinitely for the associated process to exit.

Returns
  Exist code returned by child process