监视目录的变化 [英] Monitor Directory for Changes

查看:27
本文介绍了监视目录的变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很像类似的问题,我正在尝试监视 Linux 机器上的目录添加新文件,并希望在这些新文件到达时立即对其进行处理.关于实现此目标的最佳方法有什么想法吗?

Much like a similar SO question, I am trying to monitor a directory on a Linux box for the addition of new files and would like to immediately process these new files when they arrive. Any ideas on the best way to implement this?

推荐答案

查看 inotify.

使用 inotify,您可以查看用于创建文件的目录.

With inotify you can watch a directory for file creation.

这篇关于监视目录的变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆