deleting all files in documents directory
I want to add a functionality in my app that if user press back button without saving his/her data, all saved files in documents directory get deleted.. Now I dont know how to completely flush this directory. Can anybody help me here?
Replies
it is working ...
Although its not an issue but just for the curiosity that this loop not only delete the files in documents directory but also delete the complete folder `/documents` ...
Is it possible that the directory become empty but not deleted
On relaunching the project, it is there,so not an issue
Thank you
Ooops! That's what I get for writing code in a post without testing... really sorry for that.
I forgot that it returned the system files "." and ".." Ouch!
Anyway the code above has been modified to test for directories now and should only remove all files...
well this too deleting \documents directory.
I dont know why as check is there but still..!!

Have a look at these links
http://docs.coronalabs.com/api/library/lfs/index.html
http://docs.coronalabs.com/api/library/os/index.html