I need to do two things in a C/Java program.
1) Rename a file. How can I check if that file is opened for READ OR WRITE by another process. If it is opened for READ, how can I force windows to rename that file.
2) Read file, ONLY when no other process is currently writing to the file.