I have a Java application that monitors a folder for incoming XML files. When a new file is detected I need to test the file that it is not currently being updated and is close
One thing that appears to work in Windows is this - Create a File() object that represents the file in question (using constructor with full filename) - Create a second identical File Object, same way. - Try firstFile.renameTo(secondFile)
This dummy renaming exercise seems to succeed with files that are not open for editing by another app (I tested with Word), but fails if they are open.
And as the nw filename = the old filename it doesn't create any other work.