Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting a file change using the ReadDirectoryChangesW

Status
Not open for further replies.

Camel

Programmer
Joined
Aug 13, 2000
Messages
45
Location
GB
Hello Everyone !
During the last week I search all around the MSDN and various Internet sites trying to locate syntax and an example of the ReadDirectoryChangeW API call.

But let me explain myself. I am trying to monitor a Windows NT (NTFS) directory for any change on the permissions of any file and prompt the user with a message. This change can be performed using the windows explorer so the program will run at the background (as service or background task).

Does anyone of you have an idea of how this can be done (i am not consider about the service :-) ) but for the monitoring.

I tried to use the FindFirstChangeNotification and WaitForMultipleObjects but the main limitation of this approach is that it supports up to 64 files/directories and it does not return the filename of the file that is changed (if I monitor the directories).

Any help, points that you could give will really help
Thanks
 
ReadDirectoryChangesW is your best bet for monitoring directories for specific changes. You do need to know a few other API calls associated with this. (CreateFile, CreateIOCompletionPort, etc...) There is an ActiveX component written called diralert. It will monitor an unlimited number of directories for any type of changes. It does use the ReadDirectoryChangesW and associated API calls.
Very easy to use, and great learning tool if you purchase the source. The side effect of this component can be a bit annoying. When the component is monitoring any directory, clicking on a shourcut to any type of document can take up to, and more than a minute for the associated app to open. I am in the process of troubleshooting this, and have submitted the bug to diralert.com. I would still recommend buying the source ($40.00).
 
Just started a simular project for a network based backup programm, If you still need info's or if you run across somthing intresting then please post.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top