testz2.pp 642 B

12345678910111213141516171819202122232425262728293031323334353637
  1. Program testz2;
  2. uses zstream;
  3. const
  4. {$ifdef linux}
  5. eol=#10;
  6. {$else}
  7. eol=#10#13;
  8. {$endif}
  9. Var F : TGZfileStream;
  10. S : String;
  11. i :longint;
  12. c : char;
  13. begin
  14. Writeln ('Creating file.');
  15. S:='This is a sentence'+eol;
  16. F:=TGZFileStream.create('test.gz',gzopenWrite);
  17. For I:=1 to 10 do
  18. F.Write(S[1],Length(S));
  19. f.Free;
  20. Writeln ('Done.');
  21. Writeln ('Reopening file for read.');
  22. F:=TGZFileStream.Create('test.gz',gzopenread);
  23. Writeln ('Dumping contents:');
  24. While F.Read(C,SizeOf(c))<>0 do
  25. write(c);
  26. F.free;
  27. Writeln('Done.');
  28. end.
  29. $Log$
  30. Revision 1.2 2000-07-13 11:33:05 michael
  31. + removed logs
  32. }