On 10/2/2021 7:25 PM, Don Green wrote:
Looking to trigger the end of a loop by the creation of a file.
Is this possible? Is this advisable?
Currently using:
a 'for' loop with
a 'for' loop guard expression to test for the existence of a file.
Tried file-exists? but that does not seem appropriate.
Tried using Racket function: filesystem-change-evt but that did not
seem appropriate.
Is it possible to trigger an end condition on a 'for' loop by the
creation of a file?
I suspect my problem is that it takes a significant amount of time for
the operating system to register the creation of a file.
So maybe the best that can be done is to use file-exists? as it works
but there a many loops of the 'for' loop before the end condition
takes effect.
Any comments? --
Is the loop doing something else while it waits? If not, you might as
well use filesystem-change-evt.
A polling loop /may/ respond faster than waiting on an event, but at the
level of user applications that is /not/ guaranteed. Is there some
reason you (think you) need to respond very quickly when the file is
created?
George
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-users/4eef5249-c55b-6585-f04a-3cd947d26a27%40comcast.net.