[Overview][Constants][Types][Procedures and functions][Variables] | Reference for unit 'oldlinux' (#rtl) |
Create an array of null-terminated strings
Source position: line 0
function CreateShellArgV( |
const prog: String |
):ppchar; |
const prog: Ansistring |
):ppchar; |
CreateShellArgV creates an array of 3 PChar pointers that can be used as arguments to ExecVE the first elements in the array will contain /bin/sh, the second will contain -c, and the third will contain prog.
The function returns a pointer to this array, of type PPChar.
None.
|
Execute and feed command to system shell |
Program ex61; { Example program to demonstrate the CreateShellArgV function } uses oldlinux; Var S: String; PP : PPchar; I : longint; begin S:='script -a -b -c -d -e fghijk'; PP:=CreateShellArgV(S); I:=0; If PP<>Nil then While PP[i]<>Nil do begin Writeln ('Got : "',PP[i],'"'); Inc(i); end; end.
No notes exist for this page yet.