popen problems #470
-
OK, a little question out of left field. Does anyone know why this won't run
The console output is
If I run
from a cmd window it works, and this exact code used to work in ctrlr yesterday, but is consistently not working today. Happy to look at alternatives if someone knows how to gzip with raw LUA. Sooo frustrating. I had the tool working, and now it fails on this one step, which was working. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 1 reply
-
This function works (though on files without spaces - the directory can have spaces, just not the file)
|
Beta Was this translation helpful? Give feedback.
-
Would |
Beta Was this translation helpful? Give feedback.
-
I'll give it a go. Generally this type of stuff doesn't like the nested
I've got around it by adding the gzip directory to the windows PATH, so we avoid the 2 sets of quotes. I read somewhere that 2 sets of quotes can cause some issues. Also, I've put the command straight into the popen brackets, rather than referring via dosCmd. It's working again for the moment. Setting gzip to PATH probably makes it easier for cross platform work because apparently OSX comes with gzip available straight from the terminal. This is a messy little utility |
Beta Was this translation helpful? Give feedback.
-
This is what ended up working
but gzip is in the Windows PATH. I'll try again with defining the command with the path in the command to see if I can make it work. |
Beta Was this translation helpful? Give feedback.
-
That's great that you worked it out. Another lua option that can be very useful is loadstring which executes a string as code. :) |
Beta Was this translation helpful? Give feedback.
-
Do you know about ZipFile class? .def(constructor()) .def(constructor()) .def(constructor()) .def(constructor()) .def("getNumEntries", &ZipFile::getNumEntries) .def("getEntry", (const ZipFile::ZipEntry *(ZipFile::*)(int) const noexcept) &ZipFile::getEntry) .def("getIndexOfFileName", &ZipFile::getIndexOfFileName) //.def("getEntry", (const ZipFile::ZipEntry *(ZipFile::*)(const String &) const noexcept) &ZipFile::getEntry) .def("sortEntriesByFilename", &ZipFile::sortEntriesByFilename) //.def("createStreamForEntry", (InputStream *(ZipFile::*)(int)) &ZipFile::createStreamForEntry, adopt(result)) //.def("createStreamForEntry", (InputStream *(ZipFile::*)(const ZipFile::ZipEntry &)) &ZipFile::createStreamForEntry, adopt(result)) .def("uncompressTo", &ZipFile::uncompressTo) .def("uncompressEntry", &ZipFile::uncompressEntry) |
Beta Was this translation helpful? Give feedback.
-
Hmmmmm, interesting. zip itself won't work, but it looks like the zipFile support gzip - https://docs.juce.com/master/classGZIPCompressorOutputStream.html I'll have to have a look at this because OSX does not support io.popen and we need os.execute instead, but that's trickier. I'll have a look at it when I get some time. The other library I found is this one. https://github.com/SafeteeWoW/LibDeflate I think that would also work, as I'm pretty sure Deflate is the method used for gzip. I specifically need gzip because the preset files for the Eventide H9000 are .json files that have been gzipped, so I need to uncompress, edit the .json and then recompress to allow the H9000 to load the file. |
Beta Was this translation helpful? Give feedback.
This is what ended up working
but gzip is in the Windows PATH. I'll try again with defining the command with the path in the command to see if I can make it work.