Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

stat watcher

  • Loading branch information...
commit 64955c788668af6e8f53d3865df810dea052babb 1 parent 13f58b4
@silentbicycle authored
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"
Please sign in to comment.
Something went wrong with that request. Please try again.