日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

inotify java maven_INOTIFY 系列(一) 安装 和初步使用

發布時間:2025/5/22 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 inotify java maven_INOTIFY 系列(一) 安装 和初步使用 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

題記: 最近需要監控linux下某個目錄下的文件變化,網友推薦了inotify.

目錄

一 環境

系統環境

軟件環境

二 安裝

安裝前檢查

2.源碼安裝

三 驗證

正文

一.環境

1.系統環境

CENTOS 6.6 內核 2.6.32

[root@scripts-1?usr]#?lsb_release?-a

LSB?Version:????:base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch

Distributor?ID:?CentOS

Description:????CentOS?release?6.6?(Final)

Release:????????6.6

Codename:???????Final

[root@scripts-1?usr]#?cat?/proc/version

Linux?version?2.6.32-504.el6.x86_64?(mockbuild@c6b9.bsys.dev.centos.org)?(gcc?version?4.4.7?20120313?(Red?Hat?4.4.7-11)?(GCC)?)?#1?SMP?Wed?Oct?15?04:27:16?UTC?2014

[root@scripts-1?usr]#

2. 軟件環境

inotify-tools-3.14

二 安裝

2.1 安裝前檢查

據說內核版本 必須 大于等于2.6.13 (筆者 未驗證內核版本小于2.6.13,也未找到官方資料 ,所以是據說)

2. 源碼安裝

tar?-zxvf?inotify-tools-3.14.tar.gz

cd?inotify-tools-3.14

ll

./configure?--prefix=/usr

make

make?install

三驗證

3.1 報錯?inotifywait: error while loading shared libraries: libinotifytools.so.0: cannot open shared object file: No such file or directory

[root@scripts-2?inotify-tools-3.14]#?inotifywait

inotifywait:?error?while?loading?shared?libraries:?libinotifytools.so.0:?cannot?open?shared?object?file:?No?such?file?or?directory

[root@scripts-2?inotify-tools-3.14]#

解決: 執行ldconfig

[root@scripts-2?inotify-tools-3.14]#?inotifywait

inotifywait:?error?while?loading?shared?libraries:?libinotifytools.so.0:?cannot?open?shared?object?file:?No?such?file?or?directory

[root@scripts-2?inotify-tools-3.14]#?ldconfig

[root@scripts-2?inotify-tools-3.14]#?inotifywait

No?files?specified?to?watch!

[root@scripts-2?inotify-tools-3.14]#

參考資料:

https://github.com/rvoicilas/inotify-tools/wiki

http://www.ibm.com/developerworks/cn/linux/l-ubuntu-inotify/index.html

http://www.infoq.com/articles/inotify-linux-file-system-event-monitoring

總結

以上是生活随笔為你收集整理的inotify java maven_INOTIFY 系列(一) 安装 和初步使用的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。