Page 1 of 1

UnZip files

Posted: Sun Sep 02, 2018 7:53 pm
by xabierpayet
how i can unzip a file with drawers and subdrawers? i´m attempting it, but doesn´t work here,
i can only unzip all the zipped files in the same drawer, can you post a short example for do it?
thanks

Re: UnZip files

Posted: Mon Sep 03, 2018 10:25 pm
by airsoftsoftwair
I don't have an example handy, but it's really not difficult. From the top of my head:

1) zip.OpenArchive()
2) Iterate over all entries in the ZIP archive (can be queried using #ZIPATTRNUMENTRIES)
3) Call zip.GetFileAttributes() on each entry to determine if entry is a file or a directory
4) If it's a directory, call MakeDirectory() to create it
5) If it's a file, call zip.ExtractFile() to unpack it
6) zip.CloseArchive()

That's pretty much about it. Shouldn't be difficult to implement. You don't even need recursion, just a simple for loop.

Re: UnZip files

Posted: Wed Sep 05, 2018 3:54 pm
by xabierpayet
perfect, working nice here
thanks