Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Zipping a directory
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01424198
Message ID:
01424219
Vues:
52
>>>Hi
>>>
>>>I've been down this road before but have lost my code and need a solution in a hurry
>>>
>>>Anyone have a really simple prg for zipping up a directory?
>>>
>>>Thanks
>>>
>>>Colin
>>
>>Check Zipping files from inside VFP Thread #1222560
>
>Naomi - I simplified the code as follows and it works a treat
>
>lcDataPath='o:\swedvfp\vfp\'
>lcZipFileName="o:\zips\colin.zip"
>strtofile(chr(0x50)+chr(0x4B)+chr(0x05)+chr(0x06)+replicate(chr(0),18),lcZipFileName)
>oShell=CREATEOBJECT("shell.application")
>FOR EACH ofile IN oShell.NameSpace(lcDataPath).items
> WAIT WINDOW "Archiving File: " + oFile.Name + ' to ' + lcZipFileName NOWAIT
> oShell.NameSpace(lcZipFileName).copyhere(ofile)
>ENDFOR
>WAIT clear
>
>Thanks as always

You're welcome. If you have a chance, test it on Windows Vista and Windows 7 - it may not work as is. Also there were some concerns raised in one of the older threads of the legality of this code - nothing definite, though.

Let me know if you want to look up these threads just in case.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform