wqweto / ZipArchive

A single-class pure VB6 library for zip with ASM speed
MIT License
55 stars 23 forks source link

Question #34

Open antoninononooono opened 1 week ago

antoninononooono commented 1 week ago

I have spent really much time with your project now, it is really impressive and good! Thank you!

When I started experimenting with it, I accidentally experienced a feature or a bug which confused me, so I tried to avoid it. Now I noticed that I actually need it:

I don't know what I did, but I accidentally created a new directory structure inside the zip file, for example:

d:\temp.zip When you opened it you saw c_\Users\\MyUserName_Desktop

I don't remember exactely anymore, but it was exactely what I needed.

Can you show / tell me how to create such a "virtual directory structure" inside the zip?

All the folders were empy, except the one (and its subfolders) that I put in the argument.

It was somewhere around here in the code:

If lIdx = 0 And IncludeEmptyFolders

But I can't reproduce it.

wqweto commented 1 week ago

Not sure exactly what you might have done but the "official" way to specify the exact name of a file inside the archive is by using the second (optional) parameter of AddFile method i.e. .AddFile "D:\TEMP\aaa.pdf", "myfolder/report.pdf" will add aaa.pdf and store it as report.pdf in myfolder subdirectory.

If you don't pass this second parameter then the filename part of the source file i.e. aaa.pdf is used as name for the archive entry by default without drive or folder from its full name.