help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Procedures and functions][Variables] Reference for unit 'Unix' (#rtl)

fpSystem

Execute and feed command to system shell

Declaration

Source position: line 0

function fpSystem(

  const Command: String

):cint;

function fpSystem(

  const Command: AnsiString

):cint;

Description

Shell invokes the bash shell (/bin/sh), and feeds it the command Command (using the -c option). The function then waits for the command to complete, and then returns the exit status of the command, or 127 if it could not complete the FpFork or FpExecve calls.

Errors

Errors are reported in LinuxError.

See also

POpen

  

Pipe file to standard input/output of program

Shell

  

Execute and feed command to system shell

FpFork

  

Create child process

FpExecve

  

Execute process using environment

Example

program example56;

uses Unix;

{ Program to demonstrate the Shell function }

Var S : Longint;

begin
  Writeln ('Output of ls -l *.pp');
  S:=fpSystem('ls -l *.pp');
  Writeln ('Command exited wwith status : ',S);
end.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505