Installer import into contrib (real import this time)
[dragonfly.git] / contrib / bsdinstaller-1.1.6 / src / backend / lua / scripts / test / wait_for.lua
1 -- $Id: wait_for.lua,v 1.1 2005/02/01 22:10:14 cpressey Exp $
2
3 require "app"
4
5 App.start{
6     name = "wait_for test program",
7     logfile = "wait_for.log"
8 }
9
10 os.execute("rm -f /tmp/foo")
11 os.execute("sleep 10 && touch /tmp/foo &")
12
13 local ok, t = App.wait_for{
14     predicate = function()
15         return FileSystem.is_file("/tmp/foo")
16     end
17 }
18 App.log("App.wait_for() returned %s, %d", tostring(ok), t)
19
20 App.stop()