1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: io.backend io.monitors
4 core-foundation.fsevents continuations kernel sequences
5 namespaces arrays system locals accessors destructors ;
6 IN: io.unix.macosx.monitors
8 TUPLE: macosx-monitor < monitor handle ;
10 : enqueue-notifications ( triples monitor -- )
12 >r first { +modify-file+ } r> queue-change
15 M:: macosx (monitor) ( path recursive? mailbox -- monitor )
16 [let | path [ path normalize-path ] |
17 path mailbox macosx-monitor new-monitor
18 dup [ enqueue-notifications ] curry
19 path 1array 0 0 <event-stream> >>handle
22 M: macosx-monitor dispose