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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ZLIB TO COMPRESS ENTIRE DIRECTORY

Status
Not open for further replies.

craigsboyd

IS-IT--Management
Nov 9, 2002
2,839
US
Anyone ever used the zlib.dll to compress an entire directory (and it's contents) into a single file? If so could you give me a little headstart here? Slighthaze = NULL
 
I'd even be willing to settle for a free ocx that will do it Slighthaze = NULL
 
wgcs,

NICE FAQ faq184-2070 -THANK YOU!
Slighthaze = NULL
 
Well I thought it was a godsend anyways, turns out that the method outlined by wgcs in his fact gives me an error with the lcBuff variables of "String is too long to fit" when a table of any moderate size is sent to it. Strange too, because right up above that wgcs has something about it being able to handle a terrabyte and yet it blows up when a 32mb table is sent... VFP just can't create a buffer of strings that long i guess, unless anyone else knows what is going on? Slighthaze = NULL
 
Running from the command window...

this works:
lcBuff = SPACE(16777184)

this errors out with "string too long to fit"

lcBuff = SPACE(16777185)

Slighthaze = NULL
 
well members,

I ended up using the SAWZip.dll works like a charm and creates zip compatible files and its opensource/free. I am a little curious whether anyone else gets the error mentioned above, but for now I am on to other things. Slighthaze = NULL
 
Hi
I am using some freeware dll's together with explaining .prg's
I use them in my application to copy the full data-map to store and restore as backup.
Once interested give me a shout and i will mail together with my code-snippets.
-Bart
 
Hi Slighthaze,

Sorry if the comment in the routine was misleading: I hadn't tested with more than a couple megabytes but wanted to leave room to store any possible size for verification...

So the capacity for compressing is limited to the maximum string size that VFP can handle, which is about 16MB (documented to be exactly 16,777,184 characters, presumably because 3 bytes are used to store the length, and 1 byte for a null terminator, for a total of (2^24 - 24 - 8) )

Thanks for pointing it out! (I adjusted the FAQ to note this limitation)
 
Hi ,
I did a quick try and found that a zipfile of over 50 mB is no problem
-Bart
 
Slighthaze, Bart:

Would you like to share some sample code that could be used to formulate a FAQ? (or just write a FAQ...)

I had searched for a free/open source DLL to create zip -compatible files; Everybody repackages the ZLIB.dll as OCX's (the SawZip.dll seems to be an ActiveX control that, itself, still needs and uses zlib.dll) when they make things that can create .ZIP compatible files.

The trouble with OCX's is that they require registration on the computer, which, in turn, requires the user to have the rights to register, which (particularly with WinXP) is becoming increasingly uncommon.

So, the OCX MUST install with the application, or else you can't rely on it's being there and useable.
 
my app runs in XP-home
where to mail some stuff to ?
-Bart
 
wgcs and Bart,

Yes, I am using the SAWZip.dll and the registration isn't a problem on this particular project. I did post some quick and simple code in this forum for using the SAWZip.dll to zip and unzip directories. I haven't found any other way to do it either. Bart, thank you for the code offer and you can send it to craig1442@mchsi.com

If someone ever creates completely VFP compression/uncompression I think it would be a big asset to the VFP community given the lack of anything I was able to find. Backup/Restore ability with compression is something most products need.

I also used a solution posted in FAQ by Mike Gagnon using the Cabarc.exe (didn't need to use Extract.exe because Cabarc has ability to extract also), but found that it ran way to slow and it was next to impossible to get any kind of progress indication.

Thank you both for keeping this thread alive and taking the time to respond. Slighthaze = NULL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top