# Demonstrate file/flush -- tail %flushtest.csv to see new
# entries appended as the program runs. Otherwise, entries
# wouldn't be visible until file was closed. @oofoe
(def fp (file/open "flushtest.csv" :wb))
(file/write fp "Timestamp,Fiducial\n")
(for i 0 5
(print "-- Writing " i)
(file/flush (file/write fp (string (os/time) "," i "\n")))
(os/sleep (* 5 (math/random))))
(file/close fp)