[Overview][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'process' (#fcl)

RunCommandIndir

Run a command in a specific directory.

Declaration

Source position: process.pp line 176

function RunCommandIndir(

  const curdir: string;

  const exename: string;

  const commands: array of string;

  var outputstring: string;

  var exitstatus: Integer

):Integer;

function RunCommandIndir(

  const curdir: string;

  const exename: string;

  const commands: array of string;

  var outputstring: string

):Boolean;

function RunCommandInDir(

  const curdir: string;

  const cmdline: string;

  var outputstring: string

):Boolean;

Arguments

curdir

  

Current working directory for the command.

exename

  

Executable to start.

commands

  

Command-line arguments for the executable.

outputstring

  

String to return the commands output.

exitstatus

  

On exit, contains the exit status of the process

Function result

True if the command was started succesfully.

Arguments

curdir

  

Current working directory for the command.

exename

  

Executable to start.

commands

  

Command-line arguments for the executable.

outputstring

  

String to return the commands output.

Arguments

curdir

  

Current working directory for the command.

cmdline

  

Filename of binary to start plus command-line arguments separated by whitespace

outputstring

  

String to return the commands output.

Description

RunCommandInDir will execute binary exename with command-line options commands, setting curdir as the current working directory for the command. The output of the command is captured, and returned in the string OutputString. The function waits for the command to finish, and returns True if the command was started succesfully, False otherwise.

If a ExitStatus parameter is specified the exit status of the command is returned in this parameter.

The version using cmdline attempts to split the command line in a binary and separate command-line arguments. This version of the function is deprecated.

Errors

On error, False is returned.

See also

TProcess

  

Class to start and control other processes.

RunCommand

  

Execute a command in the current working directory


Documentation generated on: Nov 14 2015