summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-06-17 01:25:48 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-06-17 01:25:48 -0400
commit9356f11c6077f61e6bda9758f12b3f76b68991e3 (patch)
tree0f6ff464bae3eb9aa5edf38add7a97500ff77392 /doc
parentde04f7153cfece4d9af10e84413872713881f286 (diff)
surveyed the OSX and BSD options for file monitoring
Diffstat (limited to 'doc')
-rw-r--r--doc/design/assistant/inotify.mdwn31
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/design/assistant/inotify.mdwn b/doc/design/assistant/inotify.mdwn
index baa420b4e..02c30752d 100644
--- a/doc/design/assistant/inotify.mdwn
+++ b/doc/design/assistant/inotify.mdwn
@@ -3,6 +3,8 @@ inotify for changes, and automatically annexing new files, etc.
There is a `watch` branch in git that adds the command.
+[[!toc]]
+
## known bugs
* A process has a file open for write, another one closes it,
@@ -48,6 +50,35 @@ There is a `watch` branch in git that adds the command.
* When you `git annex unlock` a file, it will immediately be re-locked.
+## beyond Linux
+
+I'd also like to support OSX and if possible the BSDs.
+
+* kqueue ([haskell bindings](http://hackage.haskell.org/package/kqueue))
+ is supported by FreeBSD, OSX, and other BSDs.
+
+ From what I can find, kqueue does not provide full directory watching
+ capabilities. To watch a file, you have to have an open file descriptor
+ to the file. This wouldn't scale.
+
+ Gamin does the best it can with just kqueue, supplimented by polling.
+ The source file `server/gam_kqueue.c` makes for interesting reading.
+ Using gamin to do the heavy lifting is one option.
+ ([haskell bindings](http://hackage.haskell.org/package/hlibfam) for FAM;
+ gamin shares the API)
+
+* hfsevents ([haskell bindings](http://hackage.haskell.org/package/hfsevents))
+ is OSX specific.
+
+ Originally it was only directory level, and you were only told a
+ directory had changed and not which file. Based on the haskell
+ binding's code, from OSX 10.7.0, file level events were added.
+
+ This will be harder for me to develop for, since I don't have access to
+ OSX machines..
+
+* Windows has a Win32 ReadDirectoryChangesW, and perhaps other things.
+
## todo
- Support OSes other than Linux; it only uses inotify currently.