Overwriting Text Files?
I've got a program that writes text files ... cool. Up until now, I've been tagging the text file names with a time stamp so they don't overwrite each other between program runs. Now I'd like to (under certain criteria) actually overwrite some of these files.I know that I can overwrite the files simply by giving them the same name...(see implementation notes) ...but do I need to be concerned about the old file? ...like causing fragments or whatever?... I have a hard time imagineing that the code that writes (or in this case overwrites) the files will handle that.
Implementation notes: I basically, use a BufferedWriter chained to a FileWriter ... then I close it when Im finished.
BufferedWriter bw = new BufferedWriter(new FileWriter(myFileName));
bw.write("stuff");
bw.newLine();
bw.flush();
...
bw.close();

