Browse files

stat watcher

  • Loading branch information...
1 parent 13f58b4 commit 64955c788668af6e8f53d3865df810dea052babb @silentbicycle committed May 9, 2010
Showing with 20 additions and 0 deletions.
  1. +20 −0 test-stat.lua
View
20 test-stat.lua
@@ -0,0 +1,20 @@
+require "evc"
+
+local loop = evc.default_loop()
+print("loop: ", loop)
+
+local stat = evc.stat_init("./foo")
+print("stat (file change) watcher: ", stat)
+print("-- Watching for changes to ./foo")
+
+stat:set_cb(function(w, ev)
+ print("* Changed")
+ stat:stop(loop)
+ end)
+
+stat:start(loop)
+
+print "starting loop"
+loop:loop()
+
+print "done"

0 comments on commit 64955c7

Please sign in to comment.