EldoS | Feel safer!

Software components for data protection, secure storage and transfer

ZipWriter/Zipreader no FullPath extract option

Posted: 05/14/2010 06:02:18
by Luis Concepcion (Standard support level)
Joined: 07/21/2007
Posts: 9


When extracting files using ZipWriter or ZipReader component, the full original path is respected, so if I zip a complete directory (c:\dir), it will be extracted to "c:\whatever\dir\..".

Is it possible to avoid this and extract files excluding the original root path? For example, if I want to extract files to "c:\another" directly?

Posted: 05/14/2010 06:19:09
by Mykola Olshevsky (Basic support level)
Joined: 07/07/2005
Posts: 442

Hi. Yes, you should extract all entries of that dir, i.e. something like the following:

for i := 0 to zipReader.Directory.Entries[0].EntriesCount - 1 do
  zipReader.Extract(zipReader.Directory.Entries[0].Entries[i], 'C:\another');

Or, if your directory contains only files, you can do it via one call:

zipReader.Extract('dir\*.*', 'C:\another');



Topic viewed 1105 times

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


Back to top

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

Got it!