Man, this sure is weird. His system can compress a file that already exists, but if the code has to create the file first, it doesn't work.
Code:
PROGRAM compressiontest;
USES sdl, zipper;
VAR Zip : TZipper;
FileName : String;
SaveFile : Text;
I : Byte;
BEGIN
FileName := '1';
Assign(SaveFile, 'saves/' + FileName + '.dat');
Rewrite(SaveFile);
FOR I := 1 TO 200 DO Writeln(SaveFile, 'HELLO WORLD!');
Flush(SaveFile);
Close(SaveFile);
sdl_delay(500);
Zip := TZipper.Create;
Zip.FileName := 'saves/' + FileName + '.zip';
Zip.Entries.AddFileEntry('saves/' + FileName + '.dat', 'saves/' + FileName + '.dat');
Zip.ZipAllFiles;
Zip.Free;
Assign(SaveFile, 'saves/' + FileName + '.dat');
Erase(SaveFile);
END.
The above code creates saves/1.zip and the zip archive shows the correct size of 1.dat inside it. But unzipping that file shows that its size is 0.
Bookmarks