rb-inotify:使用FFI的Ruby彻底的inotify包装器

时间:2021-05-23 18:24:16
【文件属性】:
文件名称:rb-inotify:使用FFI的Ruby彻底的inotify包装器
文件大小:18KB
文件格式:ZIP
更新时间:2021-05-23 18:24:16
Ruby rb-inotify 这是对 Linux内核子系统的简单包装,用于监视文件和目录的更改。 它使用 gem来避免编译C扩展名。 。 用法 该API与inotify C API相似,但是具有类似Rubyish的感觉。 首先,创建一个通知程序: notifier = INotify::Notifier.new 然后,告诉它关注您感兴趣的事件的路径: notifier.watch("path/to/foo.txt", :modify) {puts "foo.txt was modified!"} notifier.watch("path/to/bar", :moved_to, :create) do |event| puts "#{event.name} is now in path/to/bar!" end Inotify可以监视目录或单个文件。 它可以注意各种事件; 有关完整列
【文件预览】:
rb-inotify-master
----.gitignore(192B)
----rb-inotify.gemspec(1008B)
----LICENSE.md(1KB)
----.travis.yml(329B)
----spec()
--------spec_helper.rb(516B)
--------notifier_spec.rb(5KB)
--------inotify_spec.rb(148B)
----README.md(4KB)
----lib()
--------rb-inotify.rb(461B)
--------rb-inotify()
----Gemfile(239B)
----.yardopts(93B)
----Rakefile(212B)

网友评论