Open ghost opened 12 years ago
This is not supported yet. Basically we'd have to expose zip_add_dir, which creates a folder. Then you'd be able to pass in filenames such as "myfolder/myfile.txt".
Sounds like something that could be useful though!
I wrote this real quick and it accomplishes what I need it to and may be useful to some one else. Right now it is super ugly I just ripped it right out of a project that needs to be finished! https://gist.github.com/1773875
If you think it is worth it I could put it into the project formally. Let me know what you think =)
Hey,
I was looking at this problem some more and had some thoughts.
I need to zip a folder structure recursively and could not find a library that did this. It is possible for me to use a format other then zip. Is there some other library I should be looking at.
If not do you think I should extend this project to handle this case?
I'm pretty sure other people would find this useful. Additions are always welcome :-)
Hey, I need this feature too (zipping a folder - preserving the structure). When will this be available ?
Thanks.
I will have a version of it on my branch by I would say Tuesday. I have to clean get through something else before I can finish it.
If you want to try to go it yourself the hardest part of the function is here https://github.com/RumpleFraggle/spo/blob/master/lib/spo.js#L255 which will dump the structure to a JSON array that you can then pass to the files function. Which is here https://github.com/RumpleFraggle/zipper
If you do try it yourself watch out for special files pipes circular links etc chilen in the directory ( and watch out for the goofy way the JSON comes out )
Hey gitfy, Didn`t forget about you =) I am getting there!
Can I call addFile and add an entire folder structure Recursively? I am a little confused!
For example I want to zip the folder:
folder --> one.txt --> two.txt --> three.txt
and maintain the folder structure!