Hi guys,
Just wondering if it was possible to test reading and writing to files in Corona?
I’m testing my scores function so this would be really handy.
Thanks in advance! [import]uid: 40538 topic_id: 9771 reply_id: 309771[/import]
Hi guys,
Just wondering if it was possible to test reading and writing to files in Corona?
I’m testing my scores function so this would be really handy.
Thanks in advance! [import]uid: 40538 topic_id: 9771 reply_id: 309771[/import]
Reading and writing worked without any problem on my Mac (OSX 10.6.7) using io.open( filePath, "r" ), io.open( filePath, "w" ) [import]uid: 5394 topic_id: 9771 reply_id: 35635[/import]
Petrsvar,
What does filePath equal?
If it is filePath = system.pathForFile( “data.txt” , system.DocumentsDirectory ), then where is storing the file?
This is what’s confusing me :S
Thanks [import]uid: 40538 topic_id: 9771 reply_id: 35639[/import]
It’s: local filePath = system.pathForFile( "data.txt", system.DocumentsDirectory ) in my case. You can create your own name for file and choose from several options concerning directory. [import]uid: 5394 topic_id: 9771 reply_id: 35669[/import]
Hey there,
If you are looking for more detailed info on this, check out; http://techority.com/2011/04/02/how-to-save-and-load-data-in-your-app/
That’s something I’ve used many times now and it works wonderfully - written for those new to saving/loading data 
Peach [import]uid: 52491 topic_id: 9771 reply_id: 35701[/import]
Hey Peach,
I’m trying to avoid using global variables but it seems like the only other way at the minute.
Petrsvar, please could you explain how you know that the file writing works? [import]uid: 40538 topic_id: 9771 reply_id: 35756[/import]