1. The usual workaround for causing Import (or any module, for that matter) to
run again is to change its inputs, i.e. change the input object that specifies
the filename.  You could change the filename itself or hand Import a new
string with the same characters (the executive does not inspect the contents,
just the cache tag).  Of course you probably don't want the net to run again
until the data changes, so...

2. There are (in samples/outboard) watchfile and watchsocket outboard modules
that have their own event loops that can trigger execution of the main net on
changing files or incoming data.  If memory serves, watchfile uses SIGALARM to
wake up periodically (at the interval you specify) and stat the file,
watchsocket blocks on a file descriptor.

Maybe I'm borrowing trouble, but there may be a synchronization issue where
watchfile triggers execution and import of an incompletely-written file.  In
which case watchfile should look for a dummy file that you touch after you've
finished writing out your data.  That does not by itself cause your data file
to be read by the main net.  Use the trick of running the output (e.g. of
watchfile(dummy)) into Format and specifying the data filename as the format
string (i.e. ignore the input that nonetheless causes Format to run).  Then
run the output of Format to the filename input of Import.

Sometimes it is necessary to define the order of execution of modules that
have no outputs.  For instance, you may wish System to run a program then have
Import read the result.  One trick to do this is to make a macro that does
have an output, usually a trivial one, and put the output-less module in it.
Then have the macro output drive Import, e.g. through Format, as described
above.  The executive sees the dependency and runs System before Import.




Richard Guenther wrote:

> On Wed, 14 Feb 2001, Stamatogiannakis Manolis wrote:
>
> > Hi!
> [...]
> > Is opendx capable of "detecting" changes in the file, or being notified
> > for them so that it will re-reading the file without user intervention?
>
> Even setting a module to "cache nothing" does not prevent it from caching
> if its inputs do not change - my workaround is to _manually_ disconnect
> / reconnect to the server... [a possibility would be to declare the module
> to have side-effects? or have an additional dummy input where a random
> number generator could be stuck to (or a special module that detects file
> changes)]
>
> Well... Richard.
>
> --
> Richard Guenther <[EMAIL PROTECTED]>
> WWW: http://www.anatom.uni-tuebingen.de/~richi/
> The GLAME Project: http://www.glame.de/

Reply via email to