Primera versio
[my-sputnik-wiki.git] / blog / Factor_file_system_monitor.lua
blob7676d6704ead99b3951af36fcebe1808fb132272
2 title = "blog/Factor file system monitor"
3 category = ""
4 prototype = "@BlogEntry"
5 content = [[
7 Sometimes I find myself editing config scripts that won't be reloaded until the program using them is restarted, and I find the editing/stopping/starting loop really annoying, so I thought it would be nice to hack a little tool that started an application and then monitors for changes in a directory tree root, stopping and restarting the app each time a change is detected... now, Factor is the only language, AFAIK, with a portable [file system monitoring library](http://docs.factorcode.org/content/vocab-io.monitors.html). It's important to note that it doesn't fall back to active polling, but use the underlying notifications API for each platform.
9 In case you didn't know, Factor is a concatenative language, a sort of modern Forth on steroids with a lispy touch, created by [Slava Pestov](http://factorcode.org/slava/). Slava himself blogged about a [simple aplication](http://factor-language.blogspot.com/2008/02/simple-application-using-iomonitor-tail.html) of this library, and probably this blog post won't add much to the original article if you already know a bit of Factor, but since most programmers aren't familiar with this concatenative lingo, I thought I would blog about building this app as an example of how to start with it.
11 If you've never played with Factor, you can download the right version for your platform [here](http://www.factorcode.org). Then visit the [getting started](http://concatenative.org/wiki/view/Factor/Learning) page. It pays off spending some time browsing the docs, because the factor team has made an effort to make the introduction as gentle as possible...
14 breadcrumb = ""
15 author = "admin"
16 creation_time = "1296313923"
17 short_desc = ""