summaryrefslogtreecommitdiff
path: root/tests/modules/fwatcher/watchdir.lua
blob: 3bd8e88978fe397256e2eb7c2001b4cb6b72e8c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import("core.base.fwatcher")

function main(watchdir)
    print("watch %s ..", watchdir)
    fwatcher.add(watchdir)
    while true do
        local ok, event = fwatcher.wait(-1)
        if ok > 0 then
            print(event)
        end
    end
end