ex79.pp 383 B

123456789101112131415161718192021
  1. Program Example79;
  2. { Program to demonstrate the FpExecVP function. }
  3. Uses Unix, strings;
  4. Const Arg0 : PChar = 'ls';
  5. Arg1 : Pchar = '-l';
  6. Var PP : PPchar;
  7. begin
  8. GetMem (PP,3*SizeOf(Pchar));
  9. PP[0]:=Arg0;
  10. PP[1]:=Arg1;
  11. PP[2]:=Nil;
  12. { Execute 'ls -l', with current environment. }
  13. { 'ls' is looked for in PATH environment variable.}
  14. fpExecvp ('ls',pp);
  15. end.