[Closed] zip directory
Is there a way from within maxscript to compress a directory?
Something like: compress “filepath”; ?
So far I’ve figured out a hack to create a zip file, I just now need to learn how to move a file into it using maxscript:
createfile "whatever.txt"
copyfile "whatever.txt" "whatever.zip"
Max ships with a stand-alone utility called MaxZip which could be called via doscommand to create a Zip archive. Of course, you could call any other command line capable stand-alone compressor… MaxZip can be passed a control text file with the file names to ZIP. It is being used internally for the File>Archive functionality.
I don’t think all systems support ZIP files as file system folders. WindowsXP lets you access them as such, but I have not tried directly manipulating them via MAXScript…
Thanks that works nice.
While I’m on the subject… if I create a file using the createfile command, how do I unload it from Max memory to modify/delete/rename it?
Lookup the topic “Maz() / UnMaz()” in the online reference. I don’t think you can give it a foldername to compress though, just one or more files.
f = createFile “whatever.txt”
…
close f
- Martijn