zip : The stdin connection has closed.

Hello,

I have the simulator crashing with this message in the console when using zip.compress :
The stdin connection has closed.

I followed the code exemple and I really don’t know why is that crashing , on both simulator and Phone (android)…
Any hint there?

You’ll need to provide more information about what you are doing before the crash occurs and be very specific. What are you doing just before the crash occurs? Can you provide us with a sample project that will reproduce the error? Does the crash occurs every time or just occasionally? What version of Solar2D Simulator are you running? On what platform? etc. etc.

When you are asking other devs to help you out, you need to provide a lot more information about your issues.

You are totally right, I have been qui te fast in writing that…
After spending some time on it, it happears that only “standards” path can be used ( no sub directory) and the list of file to be zipped a string.
When i put a table of strings, it doesn’t work at all.
Same thing for the paths, any sub directory make it fail.

Is thath normal ?

I’m not sure what you mean by the external folder, but I use Corona’s standard document method, which can decompress the file and delete it.

local ZipData = ********
local function zipListener( event )
	if ( event.isError ) then
		print( "Error!" )
	else
		for i=1,#(event.response) do
			--print( event.response[i] )
		end
		local result, reason = os.remove( system.pathForFile( ZipData, system.DocumentsDirectory ) )					  
		if result then
			print( "Done" )
		else
			-- print( "File does not exist", reason )  --> File does not exist    apple.txt: No such file or directory
		end
	end
end
local zipOptions =
{
	zipFile = ZipData,
	zipBaseDir = system.DocumentsDirectory,
	dstBaseDir = system.DocumentsDirectory,
	listener = zipListener
}
zip.uncompress( zipOptions )

Hello vb66r55,

In fact if you try to work in a sub directory of system.DocumentsDirectory, or any other system.* it crashes.
I’ve tryed with some path that works fine with other functions and it crashes 100% .

Umm…not really.
I downloaded the Zip file to the DocumentsDirectory of my Android phone in S3, unzipped it and deleted it automatically, everything was normal, and my application was running as usual.
You should try to check the permissions set.

I finally get the source of my problem… My zip is corrupted.

I don’t know how does this happen…
I generate the zip, upload to dropbox and download it again… and apparently it comes back corrupted somehow.
scratching my head right now…

The problem seems to be solved going from Network.request to network download.
No reel logic behind I must said…
I have not tried agian to change the directory as I sometimes applying the "what you don’t touch gives you no trouble " :slight_smile:

I’m not sure if you mean that there’s no real logic behind why it works and why it doesn’t, but as you said yourself, the zip that you’ve downloaded has become corrupt and therefore can’t be opened.

That means there’s most likely some error or you are downloading more information than just the zip file, which is then “bundled in” with the zip. With network download, that extra info is likely just discard automatically as the API only takes the file instead of everything that your site/service is feeding it.

There’s always logic behind why code works or doesn’t work.

You are surely right on that.
For me the two commands should have done the same job, but it’s likely they are doing it differently :slight_smile:
Anyway, I’m done with that, now I have to find some code example of PKCE implementation in LUA :slight_smile:
not a little thing to do I imagine as google seems not to get it easily hahahaha