How to delete a file from the applicationDataDirectory
Just wondering if anyone knows how to delete a file from the applicationDataDirectory?
2 Answers
-
Accepted Answer
Thanks Damien, good call on that. Did what you said and found the method I needed.
For those who want to know the answer:
var file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'myFile.txt');
if (file.exists()) {
file.deleteFile();
}Cheers
Jamesy -
The file API isn't currently documented. Download the mobilesdk sourcecode and have a look in there - it's pretty easy to find the method names.