This is what I have:
Using java Syntax Highlighting
- public void DelSomeCache(Long dirSize){
- long dirFileSize = 0;
- String sDir = Environment.getExternalStorageDirectory()+"/myDir";
- File delDir = new File(sDir);
- String[] files = delDir.list();
- for(int i=0;i<files.length;i++){
- File ftdel = new File(files[i]);
- long fileSize = ftdel.length();
- dirFileSize = dirFileSize + fileSize;
- if(dirFileSize>=dirSize){
- Log.i("Deleted",files[i]);
- ftdel.delete();
- }
- }
- }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4
It does not seem to be working. I get a message in the LogCat that files were deleted, but when I check the files are still there. Any help with what i'm missing would be appreciated.

