! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: io.backend kernel continuations namespaces sequences assocs hashtables sorting arrays ; IN: io.monitor array ; PRIVATE> HOOK: io-backend ( path recursive? -- monitor ) : next-change ( monitor -- path changed ) dup check-monitor dup monitor-queue dup assoc-empty? [ drop dup fill-queue over set-monitor-queue next-change ] [ nip dequeue-change ] if ; SYMBOL: +add-file+ SYMBOL: +remove-file+ SYMBOL: +modify-file+ SYMBOL: +rename-file+ : with-monitor ( path recursive? quot -- ) >r r> with-disposal ; inline