Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Craig Boyds vfpcompression.fll / ignore sub-folders
Message
From
28/07/2014 11:15:32
 
 
To
27/07/2014 16:25:49
General information
Forum:
Visual FoxPro
Category:
Third party products
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01604787
Message ID:
01604827
Views:
112
>I have just started looking at VFPCompression.
>
>It appears that if you zip a folder it includes all sub-folders as well. Is there any way to specify that it zips the files but ignores the sub-folders?

As a workaround you could add the files one by one to the zip archive. Create a collection of the files in the folder and you can do something like this:
LPARAMETERS toFiles AS cCollection OF aBasicGen, ;
		tcZipFile, tcPassword
*
LOCAL llRetVal
llRetVal = ZipOpen(tcZipFile)
*
IF llRetVal
	*
	FOR EACH lcFileName IN toFiles
		IF VARTYPE(tcPassword) = "C"
			llRetVal = ZipFile(lcFileName, .T., tcPassword)
		ELSE
			llRetVal = ZipFile(lcFileName, .T.)
		ENDIF
	ENDFOR
	*
	ZipClose()
	*
ENDIF
*
RETURN llRetVal
Christian Isberner
Software Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform