Thanks, Dupéron, that's helpful.

On Fri, Jan 20, 2017 at 8:35 PM, Dupéron Georges
<[email protected]> wrote:
> Le vendredi 20 janvier 2017 19:47:11 UTC+1, David K. Storrs a écrit :
>> I see that I can get the event telling me that something changed.  As
>> far as I can tell the event contains no information about *what*
>> changed, it simply alerts that *something* changed.  Likewise, the
>> monitor is only for the directory that I point it at, not for the
>> subdirectories.
>
> There *should* be a way to know what changed, at least in Linux as inotify 
> allows this IIRC. Someone already wrote an FFI wrapper for inotify, hopefully 
> it suits your needs (if it does, it would be cool to send a Pull Request to 
> turn the repo in a Racket package, so that it can be put on 
> pkgn.racket-lang.org):
>
> https://github.com/samdphillips/racket-inotify
>
> As for monitoring subdirectories, unfortunately (and surprisingly) this is 
> not possible with inotify on Linux. From the man page:
>
>     Inotify monitoring of directories is not recursive: to monitor
>     subdirectories under a directory, additional watches must be created.
>
> Fortunately, this should be easy enough to do in Racket, thanks to the 
> wonderful in-directory:
>
> (define (watch-recursively d)
> (for ([subnode (in-sequences (in-value d) (in-directory d))])
>   (when (directory-exists? subnode) ;; filter out files
>     (watch-the-directory subnode)))
>
> This might take a while (and use up some resources) when watching a large 
> directory :-( .
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to