I'm coding a Java Application right now and it has to read through a file. I'm using this method to do so:
BufferedReader mb_reader = new BufferedReader(new FileReader(f1));
int lines = 0;
while (null != (mb_line = mb_reader.readLine())) {
lines++;
//something to do
}
Everything works fine but it's possible that the file has to be changed from outside (for example).
I have a mthod that tests if the file exists and then open this reader.
But if I now try to rename the file in the Windows Explorer
it just says that the file is opened in Java and can not be renamed.
Is there a way to make it possible to rename it even if it's opened?