文件系统监听器 [英] File System Listener
本文介绍了文件系统监听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道是否有可能在我的应用程序中有一个侦听器,用于在将文件添加到文件系统时通知事件.有人可以用这个来指导我吗.
I would like to know if it is possible to have a listener in my application for notifying events when a file is added to the file system. Can someone kindly guide me with this.
谢谢.
推荐答案
您应该使用 FileObserver
监视文件或目录的更改.
You should use a FileObserver
to monitor for changes to files or directories.
似乎有一个示例此处,但是我还没有尝试过,所以不能保证它的正确性.
There seems to be an example here, but I've not tried it so can't vouch for it's correctness.
这篇关于文件系统监听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文