开发者

Tracking changes in a directory programmacticaly

I have to write a litle a开发者_如何学Cpp that will process files saved in a given dir. I doesn´t pleases me the idea of writing infinite loops, timers and that kind of stuff.

I´d like to know if there if (I would bet a finger that there is!) there is any windows API that would send my app a message for any file saved in that given dir.


ReadDirectoryChangesW is non-trivial to use correctly. There is a working sample here. I have worked with production code closely derived from this, and I've found no better sample to work from.

Note that there are known issues with the API (admittedly corner cases that may not affect you) that are described here and here, and further suggestions on usage here.


The function you're looking for is ReadDirectoryChangesW.


you can use the FindFirstChangeNotification funciton too. Exist an component called TJvChangeNotify from the JEDI JVCL collection wich encapsules this function which makes it easier to use.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜