Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynazip - return count of files in a zip
Message
De
14/03/2008 08:08:50
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01301984
Message ID:
01302074
Vues:
17
>>>Now that dynazip is going away, I suddenly have an urgent need to return the count of files contained in a ZIP file using dynazip.
>>>
>>>Zipping and Unzipping are no problem.
>>>
>>>How do I get a count of files? I see ActionDZ=1 should count the files, but where do I retrieve the count?
>>
>>I haven't used DynaZIp in years and have an old copy lying around. The documentation refers to a ReturnCount property of the Unzip control that should have the number of files in the zip file. Of course that may hav echanged completely by now.
>
>I don't see that in the object that I have (wish I did!). I think we may actually have to dig up the manual at my client's site..

Maybe this sample from the manual I have might help:

Below is an example of a simple call into the DUNZIP DLL that does a quick
check on the validity of the indicated ZIP file (szTestFile) by performing an
item count. This example first initializes the UNZIPCMDSTRUCT to "plain
vanilla" values through the use of the initialization procedure described in the Comments section above. It then sets up call-specific items as required, and makes the call into the DLL. The response is one of the UE_ constants as
defined in the DUNZDLL.H file.

BOOL validZIPFile(LPSTR szTestFile){
int response;
UNZIPCMDSTRUCT ucs;
initUNZIPCmdStruct((UNZIPCMDSTRUCT FAR *)&ucs);
ucs.lpszZIPFile = (LPSTR)szTestFile;
ucs.function = UNZIP_COUNTALLZIPMEMBERS;
if((response = dunzip((UNZIPCMDSTRUCT FAR *)&ucs))
!= UE_OK) return FALSE;
return TRUE;
}

I think the relevant bit is setting the UNZIP_COUNTALLZIPMEMBERS as the action and then doing the unzip. Of course, as I said before this is from an old version of the library which I never bothered upgrading as I stopped using it, so it may be irrelevant these days, but searching on that in your manual/help file may show you the way.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform