Hi there,
I have tried the example stated here (bottom of document):
http://docs.coronalabs.com/guide/data/readWriteFiles/index.html
Added the required copyFile and doesFileExist functions as per examples and then called:
copyFile( “test.txt”, nil, “test.txt”, system.DocumentsDirectory, true )
Problem is, it silently (I have debugged on a Galaxy S3) won’t copy the file “test.txt” that sits in my project folder (where main.lua is)
Since the documentation says:
Here’s how to copy cat.png to the documents directory on Android, assuming it’s stored as cat.png.txt. This technique works for all platforms, so if you make it work for Android, it will work everywhere.
Is there any reason why this is not working?
PS. I have even added a permission “android.permission.WRITE_EXTERNAL_STORAGE” but it just won’t work.
This is the output in the logcat if I print system.pathForFile(nil, DocumentsDirectory) from the device:
07-02 21:19:40.849 17092-17118/? I/Corona﹕ /data/data/com.mycompany.myapp/app_data
Note: everything it works file in the simulator and the file gets copied.
After spending hours trying to make it work, I really hope I’m missing something here and the documentation is not incorrect.
Any ideas?