java - Deleting files created with FileOutputStream -


I'm developing for the Android platform.
My app creates a temporary file with a simple call:

  fileAutupputable stream Fos = openFileOutput ("MY_TEMP.TXT", mode);  

This works fine because I can write it and read it normally.

The problem is that when I exit the app, I want to delete this file. I used:

  file f = new file (System.getProperty ("user.dir"), "MY_TEMP.TXT"); F.delete ()  

But it always goes wrong and the file is not deleted.
I've tried:

  file f = new file ("MY_TEMP.TXT"); F.delete ();  

And it does not work either.

I checked the best method of posting and removing the file created with FileOutputStream reference method deleteFile ( TEMP_FILE), which is simple.


Comments