home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 9
/
FreshFishVol9-CD2.bin
/
bbs
/
disk
/
watch-1.0.lha
/
Watch
/
Watch.doc
< prev
next >
Wrap
Text File
|
1994-12-06
|
5KB
|
134 lines
INTRODUCTION
First, excuse my English, as it is not my native language.
Notification is a feature of AmigaDOS 2.0+ which allows programs
to be notified in case a file or directory changes.
Watch lets you specify files and directories to be watched, and
automatically run commands if the file/dir is changed.
Not all filesystems will support this feature, (CrossDOS for one)
in particular most network filesystems won't support it.
REQUIREMENTS
At least AmigaDOS 2.0 (V36)
USE
In order for Watch to work, a background process, called Watcher,
must be installed.
You can start Watcher from the shell whenever you want, or just
add it to your startup-sequence or user-startup.
Template: WATCHER QUIET/S
The QUIET switch suppresses output of a banner and a diagnostic
message.
There will still be output when something went wrong while parsing
the arguments or you're trying to use it on a pre-2.0 machine.
There's no need to RUN Watcher, it detaches itself from the shell
it started from, so the shell can close.
When Watcher was succesfully installed, and you run it for the
second time, the process will be removed.
Notes: * Use it from Workbench with an icon and visit the Guru.
* Don't try 'Watcher ?' or redirecting the output, the I/O
channels for this to work aren't there.
Watch is a normal shell command, and is pure so it can be made
resident.
Template: WATCH FILEDIR,COMMAND,REMOVE/S,RESET/S
FILEDIR is a file or directory.
COMMAND is the command to run upon notification.
REMOVE allows you to remove an entry.
RESET allows you to remove all entries. When this switch is
present, all other arguments are ignored.
Examples: Watch - lists all entries
Watch RAM: "LIST >T:Listing RAM:" - adds this entry, or
if it existed,
replaces the command.
Watch RAM: - lists the RAM: entry
Watch RAM: REMOVE - removes the RAM: entry
Watch RESET - removes all entries
Notes: * FILEDIR and COMMAND are relative to the directory the
shell was in when the Watcher process was installed.
So it is best to use absolute paths for FILEDIR and
COMMAND, unless you know what you are doing.
For example, if the current directory when you installed
Watcher was SYS:Tools, and you add an entry like this:
Watch File "LIST >Listing", AmigaDOS actually watches
SYS:Tools/File and the contents of the SYS:Tools directory
will go to SYS:Tools/Listing...
* In case of a file, notification happens when:
- the file is created
- the file is changed
- the file is renamed
- the file is deleted
In case of a directory, notification happens when:
- the directory is created
- the directory is renamed
- the directory is deleted
- a file in the directory is created
- a file in the directory is changed
- a subdirectory is created
* Watch out for 'loops'. For example, if you have two
entries like this:
RAM:File.X = "Rename RAM:File.X RAM:File.Y"
RAM:File.Y = "Rename RAM:File.Y RAM:File.X"
When File.X is changed, its command will cause notification
and the command for File.Y will be executed. This in turn
causes notification and the command for File.X will be
executed, and so on.
* When executing commands upon notification, the output
normally will be sent to limbo. If you need the output,
use redirection to send the output of a command to a file
or device.
TODO
- Integrate Watcher and Watch into one single command.
- Remove the 255-character limit for FILEDIR and COMMAND.
- Improve internal communications. For example, if one shell is busy
listing the entries, another Watch command running in another
shell has to wait.
- Improved output. Maybe a 'notification count'?
- Anything you suggest.
STATUS
Watcher and Watch are Freeware.
DISCLAIMER
Watcher and Watch are provided "as-is" and subject to change; no
warranties are made. All use is at your own risk. No liability or
responsibility is assumed.
COPYRIGHT
Watcher and Watch are Copyright © 1994 by Ludo Dyzers.
Suggestions, bug reports and friendly messages are welcome at:
SnailMail: Ludo Dyzers
Broekhoven 18
2200 Morkhoven (Herentals)
Belgium
or
EMail: 2:292/603 (FidoNet)
THAT'S IT