摘要
ReadDirectoryChangesW是Windows系统下用于监测文件系统变化的API函数。使用Tcl的C扩展API对其进行必要的整合与包装,分别从同步调用与异步调用两个角度介绍了如何实现阻塞与非阻塞的Tcl模块,并在此基础上结合Tcl的时间通知机制,实现了单线程非阻塞的文件监控模式。
ReadDirectoryChangesW is the Windows API t o trace the changes of a certain directory monitored.A Tcl extension of the same functionality is implemented in both ways of the synchronous and asynchronous use of the Windows API.Finally,an event loop mechanism is integrated to this extension to provide the non-blocking monitoring operation in one thread.
出处
《电脑编程技巧与维护》
2010年第24期24-28,共5页
Computer Programming Skills & Maintenance