Alaska Software Inc. - XbZLib Version 2.0
Username: Password:
AuthorTopic: XbZLib Version 2.0
Andreas Gehrs-Pahl
XbZLib Version 2.0
on Fri, 27 Feb 2009 05:29:47 -0500
Hi all,

I have finally been able to update XbZLib to use the streaming Deflate
and Inflate routines of the ZLib1.dll, making it possible to handle
(virtually) any size file. This was only possible due to the help of
Pablo Botella and his OT4Xb library! Many thanks to him for all his 
support!

As usually, I haven't spent any time on updating the help files, but
as this latest Version of XbZLib (Version 2.00.143) has several new
features, I will go ahead and update the help files during the next
couple of weeks or months -- depending on available time.

New features (in Version 2.00.143):
-----------------------------------
* Support for Zip Files of up to 4GB length.

* Support for Deflating and Inflating of Files of up to 4GB length.

* New feature to Add (or Remove) a Self-Extracting Executable (SFX)
  Stub to Zip Files. I have included UnZip Version 552, a free and 
  open source program, which includes four different SFX stubs that 
  you are free to use.

* Small files (or strings) -- up to an adjustable maximum size -- can
  still be compressed in memory.

* Backwards compatibility with Version 1.4 has been retained, unless 
  you use the "low-level" methods: :AddData(), :AddEntry(), or 
  :ReplaceEntry() in your code, in which case you need to change the 
  supplied parameters.

Planned changes for the near future:
------------------------------------
* Option to Replace Zip File Entries by Deleting the old entry and
  appending a new one at the end of the zip file -- instead of replacing 
  the old entry in its current position, which might require adjusting 
  the following entries, as this might be slow, when dealing with large
  Zip files.

* Option to deflate streams directly into the zip file, rather than 
  into a temp file, which is later appended to (or inserted into) the
  Zip File. This would reduce copying of data between files, but will
  require a "Replace by Append" setting and might lead to corrupted
  Zip Files, when the process is interrupted for some reason, or the
  program crashes. Of course, this could also happen when copying the
  data from one file to another, but it is more likely during deflating.

* Update of Help File.

Possible future features:
-------------------------
* Support for Zip64 format, which allows Zip Files to be larger than
  4GB and allows zip file entries (or files) that are larger than 4GB.

* Support for Digitally Signing zip file entries.

* Support for Multi-Part Split/Spanned Zip Files.

* Support for encrypted or password-protected zip file entries. 

Version 2.00.143 requires OT4Xb Version 1.5.3.252 (or later) which I 
have included in the distribution file. I have also included compiled 
copies of XbZLib.dll and AGPZip.exe for Xbase++ Version 1.90.331 and 
1.90.350. I no longer include compiled versions for 1.82.306, but it
shouldn't be a problem to compile XbZLib in any Xbase++ version that
is compatible with OT4Xb.

The latest XbZLib Version can be downloaded from here: 

	http://www.DDPSoftware.com/XbZLib20.zip

I would appreciate your feedback about problems, errors, etc., so I can
improve this library. At this point, I would consider it to be still a 
beta version, though!

-- Andreas

---                                                                      ---
  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
  415 Gute Street                     or: Andreas@DDPSoftware.com
  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
---                                                                      ---
Pablo BotellaRe: XbZLib Version 2.0
on Fri, 27 Feb 2009 21:34:54 +0100
Hi Andreas,

> Version 2.00.143 requires OT4Xb Version 1.5.3.252 (or later) which I 
> have included in the distribution file. 

ot4xb 1.5.3.252 was a private build with some working in process
so new stuff can have some debug stuff lines that I use in the development
process but obviously must not be in inside public builds.

I've just upload a new version (1.5.4.168) to
http://news.xbwin.com/ot4xb.snapshots
would be nice if you can replace 1.5.3.252 with the new public
build inside your package, and advice about minimal version 
1.5.4.168 to support the fixed VARLEN structure commands.

>I no longer include compiled versions for 1.82.306, but it
> shouldn't be a problem to compile XbZLib in any Xbase++ version that
> is compatible with OT4Xb.
ot4xb.dll is binary compatible with Xbase++ 1.8 to the latest 1.9
including SL1 
( I think will work even with Xbase++ 1.6 but have not tested recently)

Regards,
Pablo Botella
Andreas Gehrs-Pahl
Re: XbZLib Version 2.0
on Sat, 28 Feb 2009 21:07:24 -0500
Pablo,

>I've just upload a new version (1.5.4.168) to
>http://news.xbwin.com/ot4xb.snapshots
>would be nice if you can replace 1.5.3.252 with the new public
>build inside your package, and advice about minimal version 
>1.5.4.168 to support the fixed VARLEN structure commands.

I have replaced the zip file with an updated version, which includes
your OT4XB Version 1.5.3.252 and some minor corrections and changes.

>ot4xb.dll is binary compatible with Xbase++ 1.8 to the latest 1.9
>including SL1 
>( I think will work even with Xbase++ 1.6 but have not tested recently)

I have also added compiled files for Xbase++ Version 1.82.306 again.

I will include links to the web sites of ZLib1, OT4XB, and UnZip in 
the updated documentation, and will mention the required OT4XB version.

Thanks again for providing OT4XB and all your help!

The latest XbZLib Version (2.00.145) can be downloaded from here: 

	http://www.DDPSoftware.com/XbZLib20.zip

-- Andreas

---                                                                      ---
  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
  415 Gute Street                     or: Andreas@DDPSoftware.com
  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
---                                                                      ---
Osvaldo Ramirez Re: XbZLib Version 2.0
on Sat, 28 Feb 2009 20:12:25 -0700
Thanks to you boths guys


"Now, Mr Pablo as working very hard"

news.xbwin.com/ot4xb.samples

a lot off new stuffs that make happe the programmers life.


Best Regards
Osvaldo Ramirez



Andreas Gehrs-Pahl wrote:
> Pablo,
> 
>> I've just upload a new version (1.5.4.168) to
>> http://news.xbwin.com/ot4xb.snapshots
>> would be nice if you can replace 1.5.3.252 with the new public
>> build inside your package, and advice about minimal version 
>> 1.5.4.168 to support the fixed VARLEN structure commands.
> 
> I have replaced the zip file with an updated version, which includes
> your OT4XB Version 1.5.3.252 and some minor corrections and changes.
> 
>> ot4xb.dll is binary compatible with Xbase++ 1.8 to the latest 1.9
>> including SL1 
>> ( I think will work even with Xbase++ 1.6 but have not tested recently)
> 
> I have also added compiled files for Xbase++ Version 1.82.306 again.
> 
> I will include links to the web sites of ZLib1, OT4XB, and UnZip in 
> the updated documentation, and will mention the required OT4XB version.
> 
> Thanks again for providing OT4XB and all your help!
> 
> The latest XbZLib Version (2.00.145) can be downloaded from here: 
> 
> 	http://www.DDPSoftware.com/XbZLib20.zip
> 
> -- Andreas
> 
> ---                                                                      ---
>   Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
>   415 Gute Street                     or: Andreas@DDPSoftware.com
>   Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
>   Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
> ---                                                                      ---
Andreas Gehrs-Pahl
Re: XbZLib Version 2.0
on Sun, 01 Mar 2009 23:54:29 -0500
Hi all,

I found a typo in the function "XbZ_StoreFile()" of Version 2.00.143 of
XbZLib, so I have uploaded a new, fixed copy, Version 2.00.144. If you
want to fix this yourself, rather than downloading a new copy, the error
is in line 315 of the "XbZLib.prg" file. Replace "nStep" with "nChunk" 
at the end of that line, and the problem is solved.

The (corrected) XbZLib Version (2.00.144) can be downloaded from here: 

	http://www.DDPSoftware.com/XbZLib20.zip

PS: If you wonder why 2.00.144 follows 2.00.145 (as posted in my previous
    post), I never updated the build number and the last uploaded version
    was actually still Version 2.00.143. I'm still working on 2.00.145!

-- Andreas

---                                                                      ---
  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
  415 Gute Street                     or: Andreas@DDPSoftware.com
  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
---                                                                      ---
Andreas Gehrs-Pahl
Re: XbZLib Version 2.0
on Mon, 02 Mar 2009 02:46:58 -0500
I found another error in the "XbZ_StoreFile()" function, which I have
also fixed. The new Version 2.00.145 has been uploaded. This should be
it for now. I'll try to update the help file during the next weekend.

As always, XbZLib Version 2.00.145 can be downloaded from here: 

	http://www.DDPSoftware.com/XbZLib20.zip

-- Andreas

---                                                                      ---
  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
  415 Gute Street                     or: Andreas@DDPSoftware.com
  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
---                                                                      ---
Alphonsos PangasRe: XbZLib Version 2.0
on Wed, 29 Sep 2010 17:36:00 +0300
The link below does not exist
Is the file still available in another address ?
Thanks in advance

Alfonsos Pangas
SYNPAN software

<Andreas Gehrs-Pahl> wrote in message 
news:1wq7cmg0dkq9g.1rohobbm3v8o3$.dlg@40tude.net...
>I found another error in the "XbZ_StoreFile()" function, which I have
> also fixed. The new Version 2.00.145 has been uploaded. This should be
> it for now. I'll try to update the help file during the next weekend.
>
> As always, XbZLib Version 2.00.145 can be downloaded from here:
>
> http://www.DDPSoftware.com/XbZLib20.zip
>
> -- Andreas
>
> ---                                                                      ---
>  Andreas Gehrs-Pahl              E-Mail: GPahl@CharterMI.net
>  415 Gute Street                     or: Andreas@DDPSoftware.com
>  Owosso, MI 48867-4410               or: Andreas@Aerospace-History.net
>  Tel: (989) 723-9927           Web Site: http://www.Aerospace-History.net
> ---                                                                      ---
Andreas Gehrs-Pahl
Re: XbZLib Version 2.0
on Wed, 29 Sep 2010 16:54:11 -0400
Alfonsos,

>The link below does not exist
>Is the file still available in another address ?

Yes, the web site was moved and because the IP addresses for the Web and 
FTP Server are now different, the re-direction that was implemented doesn't 
quite work correctly for the direct links to files. So, the new URL is:

	http://www.EJusticeSolutions.com/EJS_OnSite/XbZLib20.zip

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas.GP@Charter.net
       Andreas_Gehrs-Pahl@EJusticeSolutions.com
       Andreas@DDPSoftware.com
web:   http://www.Aerospace-History.net
Alphonsos PangasRe: XbZLib Version 2.0
on Thu, 30 Sep 2010 09:48:46 +0300
Thanks a lot for the quick response

Alfonsos

<Andreas Gehrs-Pahl> wrote in message 
news:1csv36ozlv44z.j44crnyzdaev$.dlg@40tude.net...
> Alfonsos,
>
>>The link below does not exist
>>Is the file still available in another address ?
>
> Yes, the web site was moved and because the IP addresses for the Web and
> FTP Server are now different, the re-direction that was implemented 
> doesn't
> quite work correctly for the direct links to files. So, the new URL is:
>
> http://www.EJusticeSolutions.com/EJS_OnSite/XbZLib20.zip
>
> Andreas
> -- 
> Andreas Gehrs-Pahl
> Absolute Software, LLC
>
> phone: (989) 723-9927
> email: Andreas.GP@Charter.net
>       Andreas_Gehrs-Pahl@EJusticeSolutions.com
>       Andreas@DDPSoftware.com
> web:   http://www.Aerospace-History.net
Hubert BrandelRe: XbZLib Version 2.0
on Sat, 12 Feb 2011 10:49:37 +0100
Hi,

I have used your XbZLib() for a long time by now.
But now I think I found an error. I hope I can explain it in english 

EXE  = c:\temp\MyTest.EXE
DBF1 = d:\data\cust1\Dat1.DBF
DBF2 = d:\data\cust1\xyz\Dat2.DBF
ZIP  = d:\data\cust1\Data1.ZIP or Data2.ZIP

If I use oZip:addFile() I can deside the basedir inside the ZIP File :

*----------------
    cZipBaseDir := "d:\data\cust1\"

    oZip := XbZLibZip():New("d:\data\cust1\Data1.ZIP")
    if oZip:IsOpen(.t.)
       oZip:AddFile("Dat1.DBF", cZipBaseDir)
       oZip:AddFile("xyz\Dat2.DBF", cZipBaseDir)
    endif
    oZip:Close()
*----------------
This will give me the perfect ZIP, but I have to do the file seek and 
walk through the subdirs.

I thinkt thats a job for the method AddDir(), but I can't get the same 
result, if the ZIP is not in curDir() !
To change the curdir() and get different results is not good.
I think AddDir() will need one more parameter to set a
base dir for the ZIP.

If I use AddDir() here...

*-------------------
    oZip := XbZLibZip():New("d:\data\cust1\Data2.ZIP")
    if oZip:IsOpen(.t.)
       oZip:AddDir("*.DBF", cZipBaseDir, ,.t.,.t.)
    endif
    oZip:Close()
*-------------------

Then the REAL path is in this ZIP, let me show it:

Data1.ZIP:
\Dat1.DBF
\xyz\Dat2.DBF

Data2.ZIP:
\data\cust1\Dat1.DBF
\data\cust1\xyz\Dat2.DBF

I think, that AddDir() needs one more parameter:

  :AddDir([<cFileSpec>],
          [<cRootDir>],
          [<cAttribs>],
          [<lSubDirs>],
          [<lAddPath>],
          [<lAddNote>],
          [<cZipBaseDir>]) --> nQuit

handling like this:

cRootDir    := "d:\data\cust1\"
cZipBaseDir := "d:\data\cust1\"   must end with '\'

if cRootDir = cZipBasseDir   cRootDir was build from curdir(), cut it
    cRootDir := substr(cRootDir,len(cZipBasseDir)+1)
else
    DEFAULT cRootDir TO ""
endif

in this way,

oZip:AddDir("*.DBF", "", ,.t.,.t.,,cZipBaseDir)

should build the Data1.ZIP same as Data2.ZIP (with the same files)

If I am right with this sight, maybe someone does have another ...

I could offer to
- change the addDir() code
- review the help files (method names and parameters)
- and send both to you for a new build
it you find this ok, please send me your email adress.

If not, I will use my recursionmodule with your addfile() 

If someone have a different view, please let me know 

Regards,
Hubert

*------------ Full Code of prog ---------
#include "Gra.ch"
#include "Xbp.ch"
#include "Common.ch"
#include "Inkey.ch"
#include "XbZ_Zip.ch"

procedure main()
    local oZip, cZipBaseDir

    cZipBaseDir := "d:\data\cust1\"

    oZip := XbZLibZip():New("d:\data\cust1\Data1.ZIP")
    if oZip:IsOpen(.t.)
       oZip:AddFile("Dat1.DBF", cZipBaseDir)
       oZip:AddFile("xyz\Dat2.DBF", cZipBaseDir)
    endif
    oZip:Close()

    oZip := XbZLibZip():New("d:\data\cust1\Data2.ZIP")
    if oZip:IsOpen(.t.)
       oZip:AddDir("*.DBF", cZipBaseDir, ,.t.,.t.)
    endif
    oZip:Close()

return
Hubert BrandelRe: XbZLib Version 2.0
on Sat, 12 Feb 2011 13:53:01 +0100
Hi,

after sending I found a lot of misspellings ...
and forgot my signature 

Regards,
Hubert

WWW: familie-brandel.de
eMail: hubert.brandel@gmx.de
see: www.xbaseforum.de
Hubert BrandelRe: XbZLib Version 2.0 - HB version
on Mon, 14 Feb 2011 01:13:06 +0100
Hi,

I have subclassed the LIB and changed the method, how I think it should 
work. Feel free to use it, if you want.

*------------------------------- code inside XbZLibZipHB.ZIP
Class XbZLibZipHB from XbZLibZip
     EXPORTED:
     Method AddDir     Replace original !
EndClass
*-------------------------------

I habe updated my ZLib1.DLL too, and tried it with 1.90.331 and 1.90.355

 zlib1.DLL
 zLib Home Site       => http://www.zlib.net/
 binary download - in the middle of the page:
    * zlib compiled DLL, version 1.2.5,
      zipfile format (100K,
      MD5 checksum 102ba2c232ef5709626db1fdeb53af18)
    * US (zlib.net)
 XbZLibZip() 2.00.146 => look in this thread for last URL

Results:

9 DBF with together 6,84 GB (7.349.427.224 Bytes)
1 DBF with 1,99 GB (2.146.304.000 Bytes) inkl.

00:46:12 Start
00:46:12 DBE:  DBFNTX
00:46:12 DBE:  1000000000  ALT etwa 1 GB
00:46:12 DBE:  2147483647  NEU etwa 2 GB

00:46:12 XbZLib.DLL-Version:  2.00.146
00:46:12 ZLib.DLL-Version:    1.2.5
00:46:12 Xbase++ Version:     Xbase++ (R) Version 1.90.355

00:46:12 Create 1. ZIP Byte:         817.298
00:46:12 Create 2. ZIP Byte:     208.667.240
00:47:32 Create 3. ZIP Byte:   3.569.971.708
00:50:13 End in 10 seconds or press key

Time 4:01 min

the new class is inside MyTest.PRG,
witch builds the test DBF and dirs too.
Also included the 1.90.355 and 1.90.331 DLL only ZIP files.

Feel free to use it.

Regards,
Hubert


XbZlib20_Install_XppW32_1.90.331.zip
XbZlib20_Install_XppW32_1.90.355.zip
XbZLibZipHB.ZIP
Zdenko BielikRe: XbZLib Version 2.0 - HB version
on Wed, 16 Mar 2011 15:22:55 +0100
Hi,

i started test this library and it works almost of time, but many times I 
get error "Not enough memory available"... so only first Zip file is 
created - see attached files
As you can see I have more than 1 GB RAM free and your created big dbf files 
I can pack without problems e.g. with WinRar.

Also, please, how can I set parameter for multi-file output with its maximum 
partial size e.g. 2 MB? WinRar have paramater -vSIZE (-v2M) and then it will 
be created more partial packed files and each will have size 2 MB except 
last one.

And last question, is it possible set password for protecting archive? 
inWinRar there is parameter -hpPASSWORD.

Please, can you show me correct calling these parameters in your test code? 
Many thanks.

TIA & Regards

                   Zdeno


s pozdravom

zdeno bielik
ace system, spol. s r.o.
stiavnick 18
949 01 nitra
http://www.acesystem.sk
tel: 0904 - 328 888
... s nami dostvate vzdy viac








XPPERROR.LOG
MyTest.PRG
MyTestLOG.txt
Andreas Gehrs-Pahl
Re: XbZLib Version 2.0 - HB version
on Thu, 17 Mar 2011 21:25:00 -0400
Zdeno,

>i started test this library and it works almost of time, but many times I 
>get error "Not enough memory available"... so only first Zip file is 
>created - see attached files

The reason for this is that Xbase++ can only use about 800MB of memory, no 
matter how much memory you have installed or configured. And you actually 
use a pretty old version of XbZLib (as shown in your log file):

>15:01:01 XbZLib.DLL-Version:  1.40.094
>15:01:01 ZLib.DLL-Version:    1.2.3
>15:01:01 Xbase++ Version:     Xbase++ (R) Version 1.90.355

You will run out of memory if you try to zip up a file that is larger than
a few hundred MB. This (over 5 year) old version of XbZLib can only zip 
files up in one piece and has to load the entire file into memory for that.

The newer 2.x versions can compress files as a stream, using much less RAM
(which can be configured) and is therefore able to zip files up to 4GB in
size and handle standard (not encrypted) zip files of up to 2GB in size, 
even if only a few hundred MB of memory are available for processing. For 
even larger files, the Zip64 format would have to be used, but that isn't 
implemented, yet. 

You can download the latest version of XbZLib (2.01.151) from here:

	http://www.EJusticeSolutions.com/EJS_OnSite/XbZLib21.zip

>Also, please, how can I set parameter for multi-file output with its maximum 
>partial size e.g. 2 MB? WinRar have paramater -vSIZE (-v2M) and then it will 
>be created more partial packed files and each will have size 2 MB except 
>last one.

Multiple volumes aren't supported at this time, but this could be added 
or implemented relatively easy. The basic functionality required for this 
already exists in XbZLib.

>And last question, is it possible set password for protecting archive? 
>inWinRar there is parameter -hpPASSWORD.

Neither password protection nor encryption are currently implemented, and
even though I would like to include this at some time, I just don't have
the various password protection specs for zip files or the time to work 
on this.

In addition, the help system hasn't been updated for a long time, either,
and you will need to consult the source code for details on the changes
that have been made since Version 1.1.

But as you have the entire source code, you can implement any changes or 
new features that you would like to have by yourself. And like Hubert, you 
could make those changes then available to the community, and they might 
be incorporated in a future update.

Hope that helps,

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas.GP@Charter.net
       Andreas_Gehrs-Pahl@EJusticeSolutions.com
       Andreas@DDPSoftware.com
web:   http://www.Aerospace-History.net
Zdenko BielikRe: XbZLib Version 2.0 - HB version
on Sat, 19 Mar 2011 11:20:55 +0100
Hi Andreas,

> you actually use a pretty old version of XbZLib
thanks for info - it works OK with downloaded new version

> Multiple volumes aren't supported at this time, but this could be added
> or implemented relatively easy.
it will be great and important new functionalitty, because sometimes
created zip file are "relative" big, if I want send it by eMail - some
eMail accounts have problems send or receive big files/attachments
- e.g. if five partial 2 MB zip files will be created, I can send without
problems 5 eMails with one single 2 MB file in each one
instead of one big eMail with 10 MB file

> Neither password protection nor encryption are currently implemented, and
> even though I would like to include this at some time
it will be super if this will be available in some next version

Regards
            Zdeno