Adding empty directory on a zip

678 views
Skip to first unread message

Netpower8

unread,
Mar 3, 2017, 2:39:14 AM3/3/17
to DroidScript
can you add an empty folder on a zip ? whats the command ?

the command add file only add file. is there a way to add an empty directory ?
 zip.AddFile('sampledir/sample.txt','/sampledir/sample.txt');


Symbroson Development

unread,
Mar 3, 2017, 3:18:39 AM3/3/17
to DroidScript
I dont know how I made it but in my spkbuilder it works. Hope you can find it out by reading the code :)
regards
SPKbuilder.spk

Symbroson Development

unread,
Mar 3, 2017, 3:22:32 AM3/3/17
to DroidScript
I think with addfile you also can add folders by just using the path

Netpower8

unread,
Mar 3, 2017, 3:32:06 AM3/3/17
to DroidScript
just tested this... nope it did not work....

i made my own zipping method... it displays a progress bar.. on zipping folders and unzip folders... but i cant seem to make it zip an empty folder...

been at this for 2-1/2 days already

Netpower8

unread,
Mar 3, 2017, 4:13:18 AM3/3/17
to DroidScript
are you sure the spk builder can add empty directory ? i just tried it... it does not seem to work.

Symbroson Development

unread,
Mar 3, 2017, 6:13:29 AM3/3/17
to DroidScript
Obviously it isn't possible. Can I ask why you need an empty folder in a zip file? ^^

Netpower8

unread,
Mar 3, 2017, 6:43:57 AM3/3/17
to DroidScript
normally on a zip utility it if the zip utility found an empty folder. it still add it. at first it may not be that important. but its more like
keeping the directory structure. this is more like a cosmetic reason. some apps might not be able to detect their directory structure is missing
and could fail to execute if it cant find the directory...

like i said its more cosmetic reason than practicality.
Reply all
Reply to author
Forward
0 new messages