File read

I have a problem with Android…

When I access to a file for reading the first time everything goes perfectly also on Android.

Then if I try to access the same is no longer readable…

On iOS this problem not exists!

Another thing is that on iOS the reading respects starting new paragraph on Android the text is all in one line without paragraph.

Some solutions?

I only use theese instructions:

local path = system.pathForFile("file.txt") local fh = io.open(path) desc = fh:read("\*a") io.close(fh)

it seems that desc variable is empty on second time I execute this code.

any ideas??

oook i found the problem!

the problem was before when i call:

system.pathForFile()

because on Android if the file not exist, this call make the empty file called.

so the second time that I call this function it doesn’t return me a nil message.

I will add a control if the file is empty…

I only use theese instructions:

local path = system.pathForFile("file.txt") local fh = io.open(path) desc = fh:read("\*a") io.close(fh)

it seems that desc variable is empty on second time I execute this code.

any ideas??

oook i found the problem!

the problem was before when i call:

system.pathForFile()

because on Android if the file not exist, this call make the empty file called.

so the second time that I call this function it doesn’t return me a nil message.

I will add a control if the file is empty…