Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Free VFP Compression Library 3

Status
Not open for further replies.

craigsboyd

IS-IT--Management
Nov 9, 2002
2,839
US
I've created an FLL that allows VFP developers to easily work with and create zip files. You can get the free FLL and detailed documentation at the link below...

VFPCompression.FLL

Any feedback on it or ideas for improvements would be greatly appreciated. Thanks.

boyd.gif

SweetPotato Software Website
My Blog
 
Hi Craig,

a bit of a pity, since there already is an FLL wrapping the zlib functions as dfpug.fll from the german speaking foxpro group ( So that was effort already spent on an FLL implementation. Obviously it's fame ended at germanys and austrias borders.

Still a nice to have functionality of course!

Bye, Olaf.
 
Olaf,

This is the first I've ever heard of such an FLL, so thank you for bringing it to my attention. Regrettably I looked in the site you provided a link to and even did a Google search for "dfpug.fll", and I came away empty handed (couldn't find a download or documenation). Can you or someone else provide me with a more direct link and/or directions for obtaining a copy of dfpug.fll?

I have questions about the dfpug.fll that might help clear up whether the FLL I created provides additional value add for the VFP Community or if I just recreated something that already existed in another FLL that was freely available to the VFP Community at large...

Does dfpug.fll come with a license that allows it to be downloaded and used by the entire world or is its distribution model and useage restrictions render it helpful to those who pay or are members of a particular User Group. I bring this up because I saw mention of "Memberware" and "library free of charge for dFPUG members" in some of the webpages that reference dfpug.fll.

Does dfpug.fll statically link to Zlib or is it dependent on a zlib.dll (or variation thereof)?

Does dfpug.fll use the latest copy of Zlib? There were some potential security vulnerabilities in versions of Zlib prior to Version 1.2.3?

Does dfpug.fll provide more/less/the same functionality that is provided by the VFPCompression.FLL?

Does dfpug.fll use MSVCRT71.dll as its C-runtime library so no additional dependency is incurred by including it in a VFP 9.0 application? If not, is the source available so it could be recompiled with Visual Studio 2003 or has a C-runtime library been static linked during compile?

...there are more questions, but those are a few off the top of my head. VFPCompression.fll is FREE, easily accessible to the

boyd.gif

SweetPotato Software Website
My Blog
 
I can't answer all your questions at once, but some:

Yes, it's called memberware, because it's meant for free usage of dfpug members.

I thought there also was a license scheme to be able to buy it as a non member.

The dfpug.fll is standalone and does not need the zlib.dll to work. It needs msvcr70.dll, I can't find a version done for VFP9 regarding this.

You may contact Venelina Jordanova, Uwe Habermann or Ericht Todt, here are their Mailadresses...

_cliptext = strconv(chrtran("DXZlbmVsaW5hQG1uZXQuYmcgKFZlbmVsaW5hI!EpvcmRhbm92YSkNVXdlQEhhYmVybWFubi1MZXUuZGUgKFV3ZSB%IYWJlc!m1hbm4pDXdpZW5%AZGZwdWcuZGUgKEVyaWNoIFRvZHQp","%!",""),14)

Bye, Olaf.
 
Thanks for the additional information and clarifications Olaf. By the way, that is quite the email address obfuscator you have there. [smile]

boyd.gif

SweetPotato Software Website
My Blog
 
Excellent Work

Regardless of "who is on first" I have used several zip libraries dll's and ocx's and the fll is by far the easiest to implement. It is fast and the price is right. I actually was just struggling with an issue of a large xml dataset streamed from a West Wind Web Connection backend to a FoxPro FAT Client, and your method to compress strings in your fll compression library is not only efficient but timely.

Thanks for the contribution


Steve Bowman
Independent Technology, Inc.
CA, USA
 
Hi craig,

Obfuscator. Well, anyone with VFP can decrypt it, just disn't want to post mail adresses in clear text.

Steve: It's not really a matter of "who is on first", it's has been a matter of effort, that could hav been spent on something else. dfpug.fll functionality is quite the same and also rather easy.

Now it's a matter of come together and put together the pieces.

The license of the VFPCompression.FLL is of course unbeatable. Together with the quality of Craig's works and the effort he takes to keep it up to date, it''s hard competition to the dfpug.fll now.

That should still be based on some version of zlib.dll of summer 2005. Dfpug.fll is at version 2 since then, I don't know of a newer compilation. It's of course always a matter of downward compatibility, if you take a newer zlib version as the base.

Bye, Olaf.
 
steveb7,
Glad to hear that the VFP Compression FLL is helping you solve a real world problem. Compressing XML is an excellent use case. Thanks for the star.

boyd.gif

SweetPotato Software Website
My Blog
 
Just run vfpcompression.fll & dfpug back to back.
dfpug took over 7 seconds compared to vfpcompression.fll's 0.3 sec
I did notice that vfpcompression.fll will skip a used file & still return .T. in its 'Folder' methods.
I had to write my own routine ( heavily borrowed from faq184-3830 ) to add the files separately, this will then display an error if a file is not available.
Andrew
 
Andrew,

Thanks for the bench mark result. Can you tell me what the number of files/folders you were zipping as well as the size?

The locked file issue is a known bug, I will try and either find a way to zip up files that are in use or at the very least return .f. so that the dev knows that something went wrong. Glad to see you found a work-around for now.

boyd.gif

SweetPotato Software Website
My Blog
 
Craig

I have rerun the tests on folder with 60 files, size is 1.7MEG.
Files were dbf & cdx with one of dbc,dct,dcx.
The zip size is 198KB.
Saving to another folder on the same drive.

Times were
dfpug 9.6 seconds
vfpcompression 0.312
exceed (old version) 0.359
dropping to dos window & running zip.exe about 2 seconds.

Re bug, I believe that is the default for most zip systems, ie they just skip the file. It would be nice if you could zip a file thats open.

Andrew
 
Hi Andrew and Craig,

dfpug.fll allows different compression levels, which one did you use. As both are using zlib functions I can't imagine that time difference can be based on the same zip settings.

Winzip skips open files and writes a log about problems, so you may decide if you want to zip again later or those skipped files are not important to you.

Even if there may be tricky ways to get at an open file, it may be a bad idea toarchive files in that state, if it's dbfs or documents which are subject to change. For dlls, exes or other nonchanging files it would be acceptable.

If you think about backup of the database of a running client/server application with many users, I'd introduce some replication mechanism, and then backup the replication database. Even if you can save each database file after several retries, the chance is high, that files are out of sync, eg the index file does not fit the dbf file or some child table is referencing a new record in a parent table backuped before that record was inserted.

Bye, Olaf.
 
Olaf

I was using the version of dfpug that came with Foxtalk2.
There is a form which allows you to choose the folder to zip & save the zip.
I timed the 'oarchive.createarchive' method.
I have now dived into that class & can now time the 'createziparchive' method. This does indeed bring the time down to 0.26, however I also switched the 'ZIPProgress' off in order to achieve this.
Vfpcompression, I used a status bar progress meter.
Also I now notice that the Dfpug zip file was infact 196KG (others are 198KG) so there must be a higher default compression. I was unable to quickly determine a way of changing the compression level.
The original figure of 9 seconds is the time my client would see when they are backing up their data.
This drops to <1 second with Xceed & Vfpcompression.

I was going to use Dfpug in my application but decided it was too slow. I put a hidden emergency backup in my product, a lifesaver for support on my payroll system.


Re file in use. I do agree with what you are saying regarding files being out of sync. But again to have a backup of the payroll files is all important to me even if they are not an exact replication.

I was also thinking of backing up my own work. I would be nice to automate a zip say every 2 hours. To be able to do this while I was working on a file would be very beneficial.
( I do currently make 2 saves with my files, 1 the original name & the other a dated save with days version number. myfile061005v1.prg, myfile061005v2.prg)

Andrew

 
Ctaig,

Can we continue using your FLL using VIsta?

-Bart
 
Hi Bart,

I'd be optimistic. I think zlib.dll is not using API calls, so it does not depend on the windows version. And the fll also just depends on the C runtime, it's just a DLL after all.

As long as the C runtime will works on Vista FLLs should work too. The way DLLs work will not change in Vista, there may just be a new flavour of DLLs with 64 bit Dlls, which can only be used by 64 bit applications.

AFAIK Vista will come in a 64 Bit and 32 Bit edition and even Vist64 will support 32 bit applications. A problem which may be signifcant is, that 64 bit applications will not run with 32 bit ODBC or OLEDB drivers. Or more general 64 Bit application can only work together with 64 bit DLLs. But that is no problem of VFP, it will remain 32 bit on Vista.

Bye, Olaf.

 
Olaf,

Thanks for your comprehensive reply.

-Bart
 
Craig,

Brilliant stuff!

But, I'm struggling with ZipOpen()

When I specify a path to create the ZIP in, the system ignores it - and uses the default path instead?

Is this meant to happen, or have I uncovered a hiccup?

B-)

Martin


Regards

Griff
Keep [Smile]ing
 
Hi Griff,

What return value do you get from ZipOpen?

As the lAppend parameter defaults to .F., it may fail to use ZipOpen() with a fullpath and filename of an already existing zip archive, eg ZipOpen("d:\some\path\myzip.zip") should fail, if d:\some\path\myzip.zip already exists, shouldn't it? ZipOpen("myzip.zip","d:\some\path\",.T.) should work then.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top