Is there any way to write a file to the sdcard?

2 replies [Last post]
anshulk
User offline. Last seen 3 years 32 weeks ago. Offline
Joined: 4 May 2012

Is there?

Replies

teufelss
User offline. Last seen 1 year 13 weeks ago. Offline
Joined: 9 Feb 2012

Needing this too ... in 2013 =/

teufelss
User offline. Last seen 1 year 13 weeks ago. Offline
Joined: 9 Feb 2012

If anyone read this ... i was able to make it work writing the full path

enable the external_write permission on the build.settings with
"android.permission.WRITE_EXTERNAL_STORAGE",

then

local lfile = io.open("/mnt/local/test.txt","w")
lfile:write("test")
lfile:close()

to a sd card the path would be /mnt/sdcard/test.txt at least on my device

hope it helps someone ...

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.