Android Question Zipping files and folders from a directory

aironium

Member
Anyone knows how to zip files and folders in B4A?

lets say we have this file tree:

πŸ“ master/
β¬œπŸ“ƒ fish.jpg
β¬œπŸ“ƒ fish2.jpg
β¬œπŸ“ shrimp/
β¬œβ¬œπŸ“prawns/
β¬œβ¬œβ¬œπŸ“ƒ fried.mp3
β¬œβ¬œπŸ“ cocktail/
β¬œβ¬œβ¬œπŸ“ƒ fruits.png


I have used Archiver. However, when zipping it, it wraps the whole "master" folder, however my goal is to zip what is inside the "master" folder.

I also tried ArchiverPlus, tried AddFolderToZip method but yields the same result. I tried zipping them recursively, swapping folder and file methods from archiverplus, but messed it up. Any suggestions?
 

aironium

Member
Alrighty, I got it now, somewhat. Turns out, a simple condition checking the file list between folders and files, without recursion works fine.

Still have some missing RaiseSynchronousEvents for archiver's addFileToZip even if there are subroutines defined already.
 
Upvote 0
Top