mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 16:59:12 +02:00
+ Initial implementation
This commit is contained in:
parent
7522173857
commit
062282a2a2
25
fcl/tests/testz2.pp
Normal file
25
fcl/tests/testz2.pp
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
Program testz2;
|
||||||
|
|
||||||
|
uses zstream;
|
||||||
|
|
||||||
|
Var F : TGZfileStream;
|
||||||
|
S : String;
|
||||||
|
i :longint;
|
||||||
|
c : char;
|
||||||
|
begin
|
||||||
|
Writeln ('Creating file.');
|
||||||
|
S:='This is a sentence'#10;
|
||||||
|
F:=TGZFileStream.create('test.gz',gzopenWrite);
|
||||||
|
For I:=1 to 10 do
|
||||||
|
F.Write(S[1],Length(S));
|
||||||
|
f.Free;
|
||||||
|
Writeln ('Done.');
|
||||||
|
Writeln ('Reopening file for read.');
|
||||||
|
F:=TGZFileStream.Create('test.gz',gzopenread);
|
||||||
|
Writeln ('Dumping contents:');
|
||||||
|
While F.Read(C,SizeOf(c))<>0 do
|
||||||
|
write(c);
|
||||||
|
F.free;
|
||||||
|
Writeln('Done.');
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user