I’m working on two projects at the same time, but they were created on two different dates. I use the same code on both projects to compress a single file. In the oldest project the file is compressed but doubles the file inside the zip. in the second I get an error followed by “The stdin connection has closed.”
Can someone explain to me how this plugin works.
should it be downloaded for each project or once it is in the simulator is it valid for all new projects?
here is the code.
local zip = require( "plugin.zip" )
local function zipListener( event )
if ( event.isError ) then
print( " Error!" )
else
print ( event["type"] ) --> compress
print ( event.response[1] ) --> myfile.txt
end
end
local zipOptions = {
zipFile = "module1.zip",
zipBaseDir = system.DocumentsDirectory,
srcBaseDir = system.DocumentsDirectory,
srcFiles = {"myfile.txt"},
listener = zipListener
}
zip.compress( zipOptions )