Is there an event for zip uncompress finished(ended) (ZipListener)

im using the below code

i want to insert the line _G.Main = require(“main1”) only when the files have finished

unpacking.

is there a  ( elseif event.phase == “ended” then )

i can insert in the below code somewhere

basically if files have finished unpacking then run code

_G.Main = require(“main1”)

local function zipListener( event )

    if ( event.isError ) then

        print( “Unzip error” )

    else

        print( “event.name:” … event.name )

        print( “event.type:” … event.type )

        if ( event.response and type(event.response) == “table” ) then

            for i = 1, #event.response do

                print( event.response[i] )

            end

        end    

    end

end

local function networkListener( event )

    if ( event.isError ) then

        print( “Network error - download failed” )

    elseif ( event.phase == “began” ) then

        print( “Progress Phase: began” )

    elseif ( event.phase == “ended” ) then

        if ( math.floor(event.status/100) > 3 ) then

            print( “Network error - download failed”, event.status )

            --NOTE: 404 errors (file not found) is actually a successful return,

            --though you did not get a file, so trap for that

        else

            local options = {

                zipFile = event.response.filename,

                zipBaseDir = event.response.baseDirectory,

                dstBaseDir = system.DocumentsDirectory,

                listener = zipListener,

            }

            zip.uncompress( options )

        end

    end

end

local params = {}

params.progress = true

local URL = "http://omnigeekmedia.com/coronasdk/test.zip"

network.download( URL, “GET”, networkListener, params, “test.zip”, system.TemporaryDirectory )

Yes and no, it is documented here:

https://docs.coronalabs.com/daily/plugin/zip/uncompress.html

In case it isn’t clear, if ‘isError’ is set to true, it failed, otherwise it succeeded:

local function zipListener( event ) if( event.isError ) then -- Failed something bad happened else -- Done... now you can do something with the files end end

Unlike network events, there are no interim (progress) events, just success or failure.

Note:  You can’t require() a downloaded or unzipped file: 

\_G.Main = require("main1")

‘require’ only looks in the resource directory, and once your app is built it can only find the pre-complied scripts.

Note: Dynamic programming is  no-no anyways.  Apple will smack you if you do this.

Yes and no, it is documented here:

https://docs.coronalabs.com/daily/plugin/zip/uncompress.html

In case it isn’t clear, if ‘isError’ is set to true, it failed, otherwise it succeeded:

local function zipListener( event ) if( event.isError ) then -- Failed something bad happened else -- Done... now you can do something with the files end end

Unlike network events, there are no interim (progress) events, just success or failure.

Note:  You can’t require() a downloaded or unzipped file: 

\_G.Main = require("main1")

‘require’ only looks in the resource directory, and once your app is built it can only find the pre-complied scripts.

Note: Dynamic programming is  no-no anyways.  Apple will smack you if you do this.