[42m
[42m                                NOTIFY
[42m                                ¯¯¯¯¯¯
[42m
[0m

[42;33m Wazzat ???
[0m
        [1mNotify[0m is a program designed to detect the creation of certain files
in your system.  It patches the DOS library [3mopen[0m, [3mclose[0m and [3mrename[0m functions
to do its magic.

        For example, you could set up [1mnotify[0m to detect all creation of .info
files.  Whenever [1mnotify[0m  would find a .info file,  it would start a program.
Any program.  In our example,  you could automatically delete all .info file
whenever the Workbench tries to open one.


[42;33m How it Works
[0m
        [1mNotify[0m is strickly a CLI program. You give it a pattern to match and
a program to run whenever a match is made. You can stop it by hitting Ctrl-C
or sending it a break command (via the CLI command break).  The template is:

    Notify RENAME/s NEW/s APPEND/s Pattern/a Command/a Args/... < From > To

The first switches (rename, new, append)  tell [1mnotify[0m  which DOS function to
modify. [1mNotify[0m detects file creation, which means either new files, modified
files or files that are renamed  (new name matches the pattern).   Note that
the switches are [3menabling[0m  (if you set none of them, nothing will happen !).
The pattern doesn't check case (it used to be sensitive)  and if an argument
contains space (ie: was in quote) it will be passed with quote when the com-
mand is invoked.


	Also,  to pass the filename that matched  the pattern to the program
you put [3mfilename [0min the command line where it would be inserted.  It is also
important to note that  unless you redirect the input and output of the pro-
gram launched via the redirection '<' and '>' at the end of the template, it
will use the same file handles as the program that created the matched file.
(See the examples at the end of this documentation).


        [1mNotify[0m will put a little program in place of the DOS [3mopen[0m, [3mclose [0mand
[3mrename [0mfunction.  It patches the library safely, thus allowing more than one
copy of itself to run at the same time and be stopped in any order.  The way
I do it is shown in the assembler file DosWedge.asm and should be used to be
compatible between us guys (right ?).


        Note that only file creations  and appends and renaming are detected
by [1mnotify[0m.  Also be careful that the program you launch when a match is made
does not create or write to a file that [1mnotify[0m  is looking for.   This would
create an infinite loop (which would stop without harm (I hope!) when memory
runs out...).  Reading the file is okay though.


        [1mNotify[0m needs the arp.library to run  (it use ARP's pattern matching)
and works only with program that calls  the dos.library in a system friendly
manner (ie: not directly).  Note that the AmigaOS 1.3 original  DOS commands
[4mdo not work[0m with [1mnotify[0m  because they call DOS directly (against Commodore's
own programming rules !).  ARP commands work just fine...


[42;33m Usage Notes
[0m
        All this seems quite abstract ?  Well, here are some uses that [1mNotify[0m
can be put to:

        - Automatic printing of files that are copied to a particular
          directory:

              Notify NEW RENAME dh0:Text_Print/* type FILENAME to prt:

        - Automatic unarchiving of downloaded files:

              Notify NEW *.lzh lz x FILENAME < NIL: > CON:0/140/640/50/LZH

        - Automatic deletion of .info files:

              Notify NEW .info delete FILENAME < NIL: > NIL:

        - You get the picture...

              Notify NEW RENAME APPEND *.pic Show FILENAME


        You must be careful with the path you give to [1mnotify[0m. The whole path
is used for file matching.  To complicate things, some program use the file-
names directly, some expand the assigned dirs to their full length  and some
change their current directory to the path name. Some tricky pattern must be
given if you must catch all possibilities, like:

        Notify NEW (baba:*.txt|dh0:baba/*.txt) show FILENAME


[42;33m Limitations
[0m
        Here are some of the limitation of [1mnotify[0m:

                - Command cannot be longer than 255 characters
                  including the filename that may be inserted.

                - Wildcard matching must also matches the path
                  of the filenames.  That may change in future
                  version by expanding locks... (yeah, right).

                - AmigaDOS 1.3 command do not work with [1mnotify[0m,
                  they are not detected because they call DOS
                  directly (hum, hum).

		- ARP seems to have some problem when lauching
		  execute.  The way around  this problem is to
		  give the command [3mshell from filename[0m.

                - Just ask Robert... he'll find more.


[42;33m NotifyDB
[0m

        To help you with debugging your script and setting,  a debug version
of [1mnotify[0m was made.   It will tell you the arguments  it read and will print
some useful information  to its standard output  (which could be redirected)
whenever it catches a filename  that matches the wildcard pattern.   You can
make an even more verbose version of [1mnotify[0m by compiling the source with the
symbol DEBUGALL enabled.


[42;33m Thanks
[0m

        I'd like to thanks some people/organisation for helping me with this:

                - Robert Williamson, beta-tester (been known for torturing
                  programs).

                - ARP and associates, for a great library.


[42;33m Author
[0m

Pierre Dak Baillargeon
2110 Préville
LaSalle, Québec
H8N 1N5


||\\/\||//
||///\||\\

[42;33m
[0m
