testproc.pp 589 B

1234567891011121314151617181920212223242526272829303132
  1. program testproc;
  2. uses classes,process;
  3. Const BufSize = 1024;
  4. {$ifdef linux}
  5. TheProgram = 'doecho';
  6. {$else}
  7. TheProgram = 'doecho.exe';
  8. {$endif}
  9. Var S : TProcess;
  10. Buf : Array[1..BUFSIZE] of char;
  11. I,Count : longint;
  12. begin
  13. S:=TProcess.Create(theprogram,[poExecuteOnCreate,poUsePipes,poNoConsole]);
  14. Repeat
  15. Count:=s.output.read(buf,BufSize);
  16. // reverse print for fun.
  17. For I:=Count downto 1 do
  18. write(buf[i]);
  19. until Count=0;
  20. writeln;
  21. S.Free;
  22. end. $Log$
  23. end. Revision 1.2 2000-07-13 11:33:04 michael
  24. end. + removed logs
  25. end.
  26. }