Post by Rich on Feb 9, 2005 6:53:20 GMT -5
Hi,
We're starting to get problems when saving a zip file, our software supports saving the file as two different types Binary Streams and XML inside the zip file. When we swap between the two (thus changing the extension), the creation of the zip can fail. It sometimes fails on an overwrite. I've tried changing the temp path also which hasn't helped (but lets me see that the zip hasn't finished writing all of the files to the zip)
It fails in the file copy routine in KpLib.pas
procedure FileCopy(const FromFile, ToFile: string);
var
S, T : TFileStream;
msg1, msg2 : string;
begin
if DoRenameCopy(FromFile, ToFile) then exit; { 2.21b4+ }
S := TFileStream.Create(FromFile, fmOpenRead);
try
T := TFileStream.Create(ToFile, fmOpenWrite or fmCreate);
It fails on the T - line. This happens especially when saving to a network drive. When I save our zip file again, it saves ok.
Any ideas?
Kind Regards
Rich
ps. Find enclosed a stack trace below
--------------------------------------------------------------------------------
|Unit |Class |Procedure/Method |Line |
--------------------------------------------------------------------------------
|KpLib.pas | |FileCopy |831 |
|KpLib.pas | |FileCopy |827 |
|VCLZip.pas |TVCLZip |MoveTempFile |1936 |
|VCLZip.pas |TVCLZip |MoveTempFile |1924 |
|VCLZip.pas |TVCLZip |ProcessFiles |1307 |
|VCLZip.pas |TVCLZip |ProcessFiles |1143 |
|VCLZip.pas |TVCLZip |Zip |633 |
|VCLZip.pas |TVCLZip |Zip |632 |
|VCLZip.pas |TVCLZip |ZipFromStream |604 |
|VCLZip.pas |TVCLZip |ZipFromStream |591 |
We're starting to get problems when saving a zip file, our software supports saving the file as two different types Binary Streams and XML inside the zip file. When we swap between the two (thus changing the extension), the creation of the zip can fail. It sometimes fails on an overwrite. I've tried changing the temp path also which hasn't helped (but lets me see that the zip hasn't finished writing all of the files to the zip)
It fails in the file copy routine in KpLib.pas
procedure FileCopy(const FromFile, ToFile: string);
var
S, T : TFileStream;
msg1, msg2 : string;
begin
if DoRenameCopy(FromFile, ToFile) then exit; { 2.21b4+ }
S := TFileStream.Create(FromFile, fmOpenRead);
try
T := TFileStream.Create(ToFile, fmOpenWrite or fmCreate);
It fails on the T - line. This happens especially when saving to a network drive. When I save our zip file again, it saves ok.
Any ideas?
Kind Regards
Rich
ps. Find enclosed a stack trace below
--------------------------------------------------------------------------------
|Unit |Class |Procedure/Method |Line |
--------------------------------------------------------------------------------
|KpLib.pas | |FileCopy |831 |
|KpLib.pas | |FileCopy |827 |
|VCLZip.pas |TVCLZip |MoveTempFile |1936 |
|VCLZip.pas |TVCLZip |MoveTempFile |1924 |
|VCLZip.pas |TVCLZip |ProcessFiles |1307 |
|VCLZip.pas |TVCLZip |ProcessFiles |1143 |
|VCLZip.pas |TVCLZip |Zip |633 |
|VCLZip.pas |TVCLZip |Zip |632 |
|VCLZip.pas |TVCLZip |ZipFromStream |604 |
|VCLZip.pas |TVCLZip |ZipFromStream |591 |