- 论坛徽章:
- 0
|
写脚本比较麻烦,用C语言实现应该简单一些。
如果是Solaris 10或OpenSolaris,有专门软件提供这种功能。
Event ports is a unified event notification framework introduced in Solaris 10 for following subsystems,
* Async I/O
* Posix Timers
* User events
* Posix Message Queues
* polling file descriptors
And for OpenSolaris, a new subsystem was added,
* File Events Notification(FEN)
More information, please refer to
http://blogs.sun.com/praks/entry/file_events_notification
If you don't prefer to use OpenSolaris, sgi_fam could be option for Solaris 10,
http://www.blastwave.org/packages.php/fam
First, install pkg-get,
http://www.bolthole.com/solaris/pkg-get.html
# pkgadd -d http://www.opencsw.org/pkg_get.pkg
And install fam,
# /opt/csw/pkg-get -i fam
View the manpage of fam,
# man -M /opt/csw/man fam |
|