Solved

Directory watcher+ReadDirectoryChangeW

Posted on 2006-07-17
6
613 Views
Last Modified: 2013-11-20
Hi Experts

I am writing a directory watcher.
If a fie is added, deleted or modified in a folder say("C:\Test")
then it should be notified by adding comments to a ListBox control
is it possible using ReadDirectoryChangeW() or using any other method.

Thank You
Shiju S N
0
Comment
Question by:Shiju Sasidharan
  • 2
6 Comments
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 250 total points
ID: 17127882
Check out the Win32 API FindFirstChangeNotification().

Following article at codeproject describes how to create a file system spy application which will help you :
http://www.codeproject.com/file/FileSpyArticle.asp

-MAHESH
0
 
LVL 48

Assisted Solution

by:AlexFM
AlexFM earned 250 total points
ID: 17127908
0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 17127950
Along with FindFirstChangeNotification() and ReadDirectoryChangeW() there are undocumented functions SHChangeNotifyRegister and SHChangeNotifyDeregister that you can use in your application to know what is going on in your folder(s).
Refer : http://pcquest.ciol.com/content/coding/102070301.asp

To use FindFirstChangeNotification() you refer MSDN sample 'Obtaining Directory Change Notifications'
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/obtaining_directory_change_notifications.asp

-MAHESH
0
 
LVL 14

Author Comment

by:Shiju Sasidharan
ID: 17361839
sorry for  the delay
Thank u all for the help

Shiju S N
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now