What will happen to Log files rotation if they are monitored/in used by another background program


I am working on a project to monitor bro log files for instance ssh.log to send any new entry that has been appended to it, to a server by a background java process.

As rotation period moves file from current directory to a another and create new file when there are records to be logged, I am curious what could happen if background monitoring program wont let those files to move somewhere as they are obviously in use by it.

I ran my program on a test directory with some test records and when I tried to move that file to simulate the real scenario, it prompted me that I cant move or delete this file as its already open in java process.

Regards, Aneela Safdar

Was this by any chance on a windows system? There is no mechanism on a unix system that would generate such an error message.