David Storrs wrote on 01/19/2017 03:08 PM:
of events but I still know nothing about detecting filesystem change
events.  I've looked through PLaneT and found nothing that seems like
an FS-monitoring package.  Can anyone suggest how to do this?

Here's a simple example, using `sync`:

#lang racket
(define my-fs-change-evt (filesystem-change-evt "/home/user"))
(printf "sync...~n")
(sync my-fs-change-evt)
(printf "synced!~n")

I ran this example on GNU/Linux, and then used the command `touch /home/user/x`, which caused the `sync` procedure to return.

See the documentation in the vicinity of that for `sync`, for other other ways to use synchronizable objects. They're essential for some kinds of I/O programming, not just GUI.

Don't be scared away by the events (and ports documentation. I've done a bunch of low-level programming in C, of I/O and such, and I still find some of the Racket documentation for related concepts to be intimidating. (Well, there is one big thing in there that's scared me off the few times I've wanted to use it, but each time, I was on the clock for a consulting client, so I did things in the known-quantity way instead. Much of the primitives are simple, however, and the work is in building correct and efficient programs around the primitives.)

BTW, You don't want "PLaneT", which was the old (and wise) package system. Almost all current development has moved from PLaneT to "pkgs.racket-lang.org".

--
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