Skip to content

FFlate zip callback not functioning! #155

Answered by 101arrowz
Umisyus asked this question in Q&A
Discussion options

You must be logged in to vote

The problem is that zip is an asynchronous function, but you want to use it in a synchronous function. Asynchronous functions can only be used with callbacks or (preferably) Promise. In other words, what you're asking is not possible; you should probably create a callback parameter for processFile to "return" your value.

Also, I'm not sure the --left bit of this code will work if you call processFile multiple times, as it doesn't actually decrement the value in the caller. left is passed by value to processFile, not as a reference.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@Umisyus
Comment options

@101arrowz
Comment options

@Umisyus
Comment options

Answer selected by 101arrowz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants