Originally posted by Meenal Srivastva:
I have'nt opened the file concerned in my code, what i mean is that the file might be open in a different editor, and if it is so, then i want to prevent its deletion.
I tried tryLock() method also, but its not recognising files which are open this way.
Try one thing, open the file in an editor and delete it from the file browser. (No java code involved!)
Both linux and windows allow such a deletion. (Tried with textpad in windows and vi in linux) So, i dont think you can do anything from the java code.
It depends on the editor as to how it opens the file.