Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 620
  • Last Modified:

Directory watcher+ReadDirectoryChangeW

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
Shiju Sasidharan
Asked:
Shiju Sasidharan
  • 2
2 Solutions
 
mahesh1402Commented:
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
 
mahesh1402Commented:
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
 
Shiju SasidharanAuthor Commented:
sorry for  the delay
Thank u all for the help

Shiju S N
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now