EldoS | Feel safer!

Software components for data protection, secure storage and transfer

about TElZipWriter, basic questions

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#24083
Posted: 03/14/2013 01:55:55
by Damien Griessinger (Standard support level)
Joined: 03/14/2013
Posts: 9

Dear support,
I'm looking to use your component zipblackbox.vlc (currently I use Tzipforge),
and I need a lite help to see if I can adapt basical functions:

Code
outStream,inStream are TMemoryStream;
fzip is TZipForge component

// Extract file from ZIP to Stream
fzip.ExtractToStream('/myfile.txt',outStream);

// Add from Stream to ZIP
fzip.AddFromStream('/myfile.txt',inStream);

// myfile.txt exists ?
result:=fzip.FindFirst('/myfile.txt',ArchiveItem,faAnyFile-faDirectory);

// fzip is currently compress something ?
if fzip.InUpdate then


What are the equivalent functions?

thanks a lot for your help
#24084
Posted: 03/14/2013 02:19:00
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for interest in our products.

Here is the equivalent code:

Code
var zip: TElZipWriter;
...


Quote
// Extract file from ZIP to Stream
fzip.ExtractToStream('/myfile.txt',outStream);

Code
var entry: TElZipArchiveDirectoryEntry;
...
entry = zip.Directory.Entries[0]; // a file entry that correspond to 'myfile.txt'
entry.ExtractionStream := outStream;
zip.Extract(entry, '');


Quote
// Add from Stream to ZIP
fzip.AddFromStream('/myfile.txt',inStream);

Code
zip.Add(inStream, 'myfile.txt');


Quote

// myfile.txt exists ?
result:=fzip.FindFirst('/myfile.txt',ArchiveItem,faAnyFile-faDirectory)

Code
var
  entry: TElZipArchiveDirectoryEntry;
...
entry := zip.Directory.EntryWithName('myfile.txt');
if (entry <> nil) and (not entry.IsDirectory) then
// file found


Quote
// fzip is currently compress something ?
if fzip.InUpdate then

You should use TElZipReader.OnExtractionStart/OnExtractionFinished events instead.
#24085
Posted: 03/14/2013 02:21:08
by Vsevolod Ievgiienko (EldoS Corp.)

BTW, SecureBlackbox evaluation distributive is shipped with a complex ZIPBlackbox sample that can be found in \EldoS\SecureBlackbox.VCL\Samples\Delphi\ZIPBlackbox\ZipArchiver folder after SBB installation.
#24110
Posted: 03/14/2013 17:20:18
by Damien Griessinger (Standard support level)
Joined: 03/14/2013
Posts: 9

Thanks so much, it's exactly what I need.

I have seen first the example, but nothing about streams.

Now I have adapt my software with zipblackbox, it's working but very very slow, I will ask for another trial without intentional slowdown.

Reply

Statistics

Topic viewed 1095 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!