Checking if a file has been opened by any process and remains open
-
Hello: I am developing a library that must automatically detect new files in a certain directory and then process them. If a user creates a file (such a text one) using any program in the directory and he edits and saves the file without closing, no action has to be taken. The action has to wait until we are sure the file edition is complete and file is closed. How can I check wether the file has been opened by any process in the local machine or even remotely? Is it possible to get a notification when the file is closed by the user? I should work out the problem using no MFCs. Any help will be really welcomed. ;P Jose M. Just re-entering programming world after a long break.
-
Hello: I am developing a library that must automatically detect new files in a certain directory and then process them. If a user creates a file (such a text one) using any program in the directory and he edits and saves the file without closing, no action has to be taken. The action has to wait until we are sure the file edition is complete and file is closed. How can I check wether the file has been opened by any process in the local machine or even remotely? Is it possible to get a notification when the file is closed by the user? I should work out the problem using no MFCs. Any help will be really welcomed. ;P Jose M. Just re-entering programming world after a long break.
look for CFile::shareExclusive in MSDN regards Rajesh
-
Hello: I am developing a library that must automatically detect new files in a certain directory and then process them. If a user creates a file (such a text one) using any program in the directory and he edits and saves the file without closing, no action has to be taken. The action has to wait until we are sure the file edition is complete and file is closed. How can I check wether the file has been opened by any process in the local machine or even remotely? Is it possible to get a notification when the file is closed by the user? I should work out the problem using no MFCs. Any help will be really welcomed. ;P Jose M. Just re-entering programming world after a long break.