In corona, to open and read contents of a file in documents directory, you use:
local path = system.pathForFile("data.txt", system.DocumentsDirectory )local f =io.open(path, "rt")local t = f:read("*all")
f:close()
In Gideros, we don't allow users to get the directory paths. Because, in the future, we plan to port Gideros to different platforms which doesn't even have a file system. Therefore, to open a file on the documents directory, simply use "|D|data.txt" as the filename:
local f =io.open("|D|data.txt", "rt")local t = f:read("*all")
f:close()
Comments
In corona, to open and read contents of a file in documents directory, you use:
To highlight your Lua code, you can try
<pre lang="lua">
print("hello")
</pre>
which results
Likes: gorkem
Testing prefix for showing an image.
Likes: big_bruhh0