ex8.pp 337 B

1234567891011121314151617181920
  1. Program Example8;
  2. { Program to demonstrate the Execv function. }
  3. Uses linux, strings;
  4. Const Arg0 : PChar = '/bin/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[3]:=Nil;
  12. { Execute '/bin/ls -l', with current environment }
  13. Execv ('/bin/ls',pp);
  14. end.