procedure watchdir

Watch a directory and trigger an action when a new file matching given pattern is created (only available on QFitsView). The remove the watch, call the procedure with empty arguments

watchdir directory, pattern, action

directory:   A string specifying the directory to watch
pattern:   A string, the file pattern to be matched
action:   A string, the dpuser script to be executed. The file name is marked as $$

To trigger reading the first extension of a FITS file when created in /tmp:
   watchdir "/tmp", "*.fits", "hhh=readfitsextension($$, 1)" Stop watching:
   watchdir "", "", ""