Forum OpenACS Development: New util::zip_file command
This is unconvenient for a software which is meant to work on both windows and linux. Also, I've found myself to recurr to similar hacks in the past because we didn't have an official way of creating zip files programmatically.
For this reason I've added util::zip_file command, in which I handle differences in command invocation between linux and windows.
I've tested my changes against the "download folder as zip file" feature in file-storage on my unix development installation. Unfortunately I don't have a Windows installation to test on, but maybe Maurizio Martignano or people from SpazioIT could report eventual bugs.
The presence of the zip utility on the system is still a requirement.
You are mentioning "windows and linux". i guess, you did not want to imply that it only works on these two and not on e.g. Mac OS X or Solaris. If this is part of the core, it is supposed to work everywhere, so it is necessary to include zip/unzip to the dependencies in the installer scripts.
We are using on our production platform mostly nx::zip , which allows e.g. to stream zip-files (e.g. from the content repository) without copying. Without that we had the problem with the direct use of zip that voluminous file-system operations could bring the fastest server to a crawl.
I haven't checked throughly about zip command compatibility, because I assumed the options I've used would be there in every current zip tool one could download.
This said, your concerns are legit. The main problem is that we are wrapping a command here, and that this command lacks a feature so basic we have to build a little script every time... very unconvenient.
Didn't know about nx::zip. It would be far better of course! Maybe I could use the same trick we did on util::http and check for the platform: if Naviserver -> nx::zip, otherwise the command hack.