ex7.pp 380 B

123456789101112131415161718192021
  1. Program Example7;
  2. { Program to demonstrate the Execve 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. { Envp is defined in system.inc }
  14. ExecVe ('/bin/ls',pp,envp);
  15. end.