Hi,
I wrote a piece of sw that is getting data from a device.
I'm storing the data in binary files in a specific folder. Each 5MB, I create a new binary.
For the moment, I filling this directory, and when I stop getting data, I launch zip process that takes all binary files one by one and copy them in the archive.
My concern is it's taking too much time (I need to zip 500-600 files of 5MB). What I do:
archive.BeginUpdate();
foreach (AbstractFile file in sourceFolder.GetFiles(true, null))
{
i++;
MainForm.SetStatusMessage("Closing ZIP... (Archiving " + i + " of " + nbOfFiles.ToString() + ")");
file.CopyTo(archive, true);
}
archive.EndUpdate();
where archive is a ZipArchive object.
I would like to improve my algorithm starting the sippage while getting data:
Each time I receive a binary, I do :
archive.BeginUpdate();
DiskFile file = new DiskFile(pFileName);
file.CopyTo(archive, true);
archive.EndUpdate();
It's good for the first 20 binary files, but when we reach the 100th file, the copy to the archive is taking to much cpu and time.
How can I do with Xceed component to generate this ZIP file in real time ?
Thanks
Ben