Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

How to delete a file from the applicationDataDirectory

Just wondering if anyone knows how to delete a file from the applicationDataDirectory?

— asked May 23rd 2010 by Richard James
  • applicationdatadirectory
  • delete
  • file
  • filesystem
0 Comments

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

    — answered May 23rd 2010 by Richard James
    permalink
    0 Comments
  • 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.

    — answered May 23rd 2010 by Damien Elmes
    permalink
    2 Comments
    • After one year the file API is still undocumented - why?

      — commented October 7th 2011 by Mario Müller
    • Lack of resources devoted to just doc updates? Lack of ability for users to add comments to the bottom of method pages to annotate stuff ourselves?
      The fact that kitchen sink filesystem example had this demonstrated over a year ago? All of the above??

      — commented October 7th 2011 by Doug Handy
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.