2
0

ex61.pp 582 B

12345678910111213141516171819202122232425262728
  1. Program Example61;
  2. { Program to demonstrate the SetTextBuf function. }
  3. Var
  4. Fin,Fout : Text;
  5. Ch : Char;
  6. Bufin,Bufout : Array[1..10000] of byte;
  7. begin
  8. Assign (Fin,paramstr(1));
  9. Reset (Fin);
  10. Assign (Fout,paramstr(2));
  11. Rewrite (Fout);
  12. { This is harmless before IO has begun }
  13. { Try this program again on a big file,
  14. after commenting out the following 2
  15. lines and recompiling it. }
  16. SetTextBuf (Fin,Bufin);
  17. SetTextBuf (Fout,Bufout);
  18. While not eof(Fin) do
  19. begin
  20. Read (Fin,ch);
  21. write (Fout,ch);
  22. end;
  23. Close (Fin);
  24. Close (Fout);
  25. end.