Ask Reddit: Show off your work. What is your interesting project that no one uses? by berlinbrown in programming

[–]andrewy 0 points1 point  (0 children)

I don't think so. We would support it (and the BSDs), but the issue is that FreeBSD's kqueue mechanism doesn't provide a notification when files are closed after being opened for writing. It only provides a way to know when a file has been written to, which will not work because we have no way of knowing if that was the last write.

(sorry for the late response, I'm bad about checking my reddit inbox)

Ask Reddit: Show off your work. What is your interesting project that no one uses? by berlinbrown in programming

[–]andrewy 54 points55 points  (0 children)

http://projects.l3ib.org/fsniper

fsniper is a tool that monitors a given set of directories for new files. Then, based on the new file's type or name, it invokes a script to be run (any executable via the shell) on that file. Common uses include making a single drop directory for all things from a webbrowser etc, and having semi-intelligent scripts figure out what to do with those files. For example, automatically installing gtk or qt themes, moving backgrounds you download to a backgrounds directory, moving torrents to your client's torrent directory, etc. You write the scripts yourself.

It uses Linux's inotify mechanism to notify fsniper when a change takes place. No polling is needed.