I am trying to check if a certain java.io.File is open by an external program. On windows I use this simple trick:
try {
FileOutputStream fos = new FileOutputStream(file);
// -> file was closed
} catch(IOException e) {
// -> file still open
}
I know that unix based systems allow to open files in multiple processes... Is there a similar trick to achieve the same result for unix based systems ?
Any help / hack highly appreciated :-)