repositorypackage
1.0.1
Repository: https://github.com/rock-go/rock-fsnotify-go.git
Documentation: pkg.go.dev
# README
fsnotify
文件状态监控
rock.fsnotify
- userdata = rock.fsnotify{name , path}
- name: 进程名
- path: 监控路径
内部接口
event
- event.op string
- event.name string
- event.create bool
- event.write bool
- event.rename bool
- event.chmod bool
local ud = rock.fsnotify{
name = "ff",
path = "/var/log",
}
ud.pipe(function(ev)
print(ev.op)
print(ev.name) -- filename
print(ev.write) -- true
end)
ud.on_err(function(err)
end)
ud.start()