如何监控某个文件夹下的变化
时间:2010-07-24
来源:互联网
HP-UX (Linux)下如何监控某个文件夹下的变化?
指的是,该文件夹下新增了文件。
用什么可以实现? 用Perl可以吗? 用ANSI C可以吗?
指的是,该文件夹下新增了文件。
用什么可以实现? 用Perl可以吗? 用ANSI C可以吗?
作者: cups_book 发布时间: 2010-07-24
当该文件夹下有新文件夹时,把新的文件夹内的数据读入数据库
作者: cups_book 发布时间: 2010-07-24
据我所知,hp-unix没有提供文件访问事件触发的机制。你去轮询吧。
作者: caravsapm70 发布时间: 2010-07-24
回复 caravsapm70
文件访问事件触发的机制?
我的想法是用一个程序,每隔一分钟,查看一下这个文件夹,这是不是你说的轮询?
用什么程序呢?
文件访问事件触发的机制?
我的想法是用一个程序,每隔一分钟,查看一下这个文件夹,这是不是你说的轮询?
用什么程序呢?
作者: cups_book 发布时间: 2010-07-24
linux下有inotify,可以监控目录文件,事件触发。
hp-unix就是你说的那样子了,我们管它叫轮询。
hp-unix就是你说的那样子了,我们管它叫轮询。
作者: caravsapm70 发布时间: 2010-07-24
本帖最后由 cups_book 于 2010-07-24 01:09 编辑
回复 caravsapm70
嗯,我在看。
http://linux.die.net/man/7/inotify
The inotify API provides a mechanism for monitoring file system events.
Inotify can be used to monitor individual files, or to monitor directories.
When a directory is monitored, inotify will return events for the directory itself, and for files inside the directory.
The following system calls are used with this API: inotify_init(), inotify_add_watch(), inotify_rm_watch(), read(), and close().
杯具的是, 我还是不知道怎么用。。。。
回复 caravsapm70
嗯,我在看。
http://linux.die.net/man/7/inotify
The inotify API provides a mechanism for monitoring file system events.
Inotify can be used to monitor individual files, or to monitor directories.
When a directory is monitored, inotify will return events for the directory itself, and for files inside the directory.
The following system calls are used with this API: inotify_init(), inotify_add_watch(), inotify_rm_watch(), read(), and close().
杯具的是, 我还是不知道怎么用。。。。
作者: cups_book 发布时间: 2010-07-24
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28