Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFPCompression.FLL
Message
From
09/04/2009 12:48:33
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01393893
Message ID:
01393984
Views:
86
Every time I use this tool, and then try to unzip the file using the Windows Explorer, it seems it makes the ZIP and every file in it password protected, even though I do not specify a password.

**UPDATE** - I just tried it with WinZip 8 and WinRAR, and they both un-zip it just fine. Must be some bug in Windows Explorer.

Can anyone verify this behavior.


I posted to Craig's blog, but he has not replied, and it's been over a month.

The basic sequence I am using is:
*-- Create / Open Zip File ---
llZipOpen=ZipOpen(lcFullPath)

*-- Make a call to Zip up the target folder -------------
llZipEmUp=ZipFolder(lcFilePathToZipUp)    && No password specified here!!!!

*-- Close the zip and display message ---------------
llZipClose=ZipClose()
Here is the Help info on ZipFolder that mentions the password parameter:
Function ZipFolder() 
Signature: ZipFolder(cFolderName[,lIgnorePaths[, cPassword]])
Parameters:
cFolderName - The full path to the folder you wish to compress.
lIgnorePaths - If you wish to ignore the relative path of the folder into the zip file that is being created you would pass .T. for this parameter. The default value for this parameter is .F. which means that paths will be respected.
cPassword - The password you wish to protect the zipped file with.
Return Value:
Logical - returns .T. if successful or .F. if the operation has failed.
Remarks:
ZipFolder() is used between calls to ZipOpen() and ZipClose(). The usual series of function calls would consist of creating/opening the zip file using ZipOpen, zipping files and/or folders using ZipFile/ZipFileRelative/ZipFolder, and then closing the zip file using ZipClose.
Here is my full code:
Set Library To 'D:\WORK\UTIL\VFP COMPRESSION\VFPCOMPRESSION.FLL'

lcYear=Alltrim(Str(Year(Datetime())))
lcMonth=Padl(Alltrim(str(Month(Datetime()))),2,'0')
lcDay=Padl(Alltrim(Str(Day(Datetime()))),2,'0')

lcHour=Padl(Alltrim(Str(Hour(Datetime()))),2,'0')
lcMinute=Padl(Alltrim(Str(Minute(Datetime()))),2,'0')
lcSec=Padl(Alltrim(Str(Sec(Datetime()))),2,'0')

lcFilePathToZipUp='\\fs4\work\data\'

lcZipFilePath=('D:\Backups')
lcZipFileName=lcYear+'.'+lcMonth+'.'+lcDay+'_'+lcHour+'h'+lcMinute+'m'+lcSec+'s.zip'

*-- Create / Open Zip File ---
lcFullPath=Addbs(lcZipFilePath)+lcZipFileName
llZipOpen=ZipOpen(lcFullPath)
If !llZipOpen
 MessageBox('Could not open zip file ' + lcFullPath)
 Return
EndIf

*-- Make a call to Zip up the target folder -------------
Wait 'Zipping ' + lcFilePathToZipUp + ' to ' + lcFullPath window nowait
llZipEmUp=ZipFolder(lcFilePathToZipUp)
If !llZipEmUp
 MessageBox('Unkown Error. Could not zip up files at ' + lcFilePathToZipUp)
 Return
EndIf

*-- Close the zip and display message ---------------
llZipClose=ZipClose()
If !llZipClose
 lcFinishedMessage='Could not close zip file:'
Else
 lcFinishedMessage='Finished Zipping ' + lcFilePathToZipUp +' to file: '
EndIf

MessageBox(lcFinishedMessage + ' ' + lcFullPath)
>Check Thread #1379824
>
>>I hope someone has a quick answer to my problem. I am using Craig Boyd's VFPCompression.FLL library to create backups (zip files). The program works fine on 8 out of 10 computers. The error message "Library file Craig VFPCompression.FLL is invalid" on XP computers.
>>Your thoughts will be appreciated. TIA
Previous
Reply
Map
View

Click here to load this message in the networking platform