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!

thread184-1284772 - Craig Boyd

Status
Not open for further replies.

keepingbusy

Programmer
Apr 9, 2000
1,470
GB

thread184-1284772 was closed sometime ago but I'm interested in the concept of this function to zip files.

On Craig's blog there are some examples one of which is:
Code:
SET LIBRARY TO LOCFILE("vfpcompression.fll")
  ?ZipFile("C:\SomeFile.txt", .F.)
SET LIBRARY TO
When I run this example, nothing happens (I have changed the file name to my own). What is it you need to do, to get this working?

I have downloaded the vfpcompression.fll file.

I'm using:
VFOX version 9
Windows XP or VISTA

Thank you
 
1. I located the newest version as the one from 8th of December 2008 here:


2. Documentation is here:

3. Every FLL needs the correct C runtime. Craigs FLLs typically need the same as VFP9, so that shouldn't be a problem. But maybe you've downloaded an earlier version?

4. I've downloaded the version linked to above and unzipped it, then ran the sample program1.prg without any problems.

Mybe that already solves your problem: newest download, sample usage code included.

Bye, Olaf.
 
On a second read of your code: That is not an example from Craigs blog. ZipFile() can only be used between a ZipOpen() and ZipClose(). ZipOpen creates a zip file, ZipFile adds a file to the Zip file and Zipclose closes the Zip file. ZipFile alone has no destination Zip file and won't work of course.

Bye, Olaf.
 

Olaf

Thank you for the post.

I ran the following which works:
Code:
SET LIBRARY TO LOCFILE("vfpcompression.fll")
?ZipOpen("ourzipfilename.zip", "\ourfolder\zips\", .F.)
?ZipFile("\ourfolder\zips\ourfile.csv", .F.)
?ZipClose()
CLEAR
SET LIBRARY TO
Matter resolved (Thank you Craig)
 
If you are looking to automate the zipping of files be sure to check out this FAQ. I used it a while back and it worked perfectly!

How to unzip files using Shell.application faq184-5113

It was submitted by Mike Gagnon.

Jim Osieczonek
Delta Business Group, LLC
 
Hi Jim

Thank you for the post. I note that the thread refers to unzipping files which I will certainly bear in mind. The end result for our zip files end up on a server having been uploaded via phpmyadmin so fortunately the unzipping happens automatically.

I'm sure the thread you posted will come in handy.

Kind regards

Lee

Windows Vista
Visual FoxPro Versions 6 & 9
 
Well, vfpcompression.fll also includes unzipfunctionality. But the zips created are compatible to other zips and so the receiver of the zip can handle it like any other.

If the files would need to be unipped within the same app, I'd rather use vfpcompression.fll to unzip zip archives created with it, though.

By the way the shell is not only capable of unzipping but also to zip files. But that's limited to at least Win XP. Not a big requirement, but vfpcompression.fll will also be able to run in win98 and me.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top