io.open weird behavior

Hi,

I’m using io.open with w+b option to write a stream to a binary file on the app doc directory as follows:

    local sink = ltn12.sink.file(io.open(system.pathForFile(fileName, system.DocumentsDirectory),“w+b”))

However, if a previous file exists, instead of erasing its data and writing the new data, it simply does nothing.

Would appreciate any help on what might be wrong here.

Does lua support w+ ?

According to docs yes, it should.

Could it be a problem in the lua lib that corona is using?

Does lua support w+ ?

According to docs yes, it should.

Could it be a problem in the lua lib that corona is using?