I'm attempting to write a program that will monitor a certain directory for file creation/deletion/move and I'm wondering if it's possible to use the API to do this? Basically I want my program to be informed immediately whenever something in a specific folder changes...

Also, is it possible from my program to restrict access to that folder (no write permission) to everyone except itself (or it's child process) while it's running?
Posted on 2003-08-27 02:58:07 by FearHQ
Hi,

Look at
"Monitoring Changes in a Directory or Directory Tree" in the win32api help file
Seems to have something about it

Ossa
Posted on 2003-08-27 05:12:02 by Ossa
You want FindFirstChangeNotification and FindNextChangeNotification, and if necessary you can also use ReadDirectoryChangesW. Read about these functions here, and some sample code here.
Posted on 2003-08-27 05:38:46 by sluggy