StopClose0   v0.04 (20 Oct 2019)
==========

This is a simple experimental module designed to stop all files and
devices being closed at once by program or by accidental command,
which can cause some programs problems.

To use, simply double-click !StopClose0. It can be run at Boot time.
To stop it, enter command *RMKill StopClose0

It will trap instances of:
  SWI OS_Find with r0 and r1=0, which indicates all files on the 
              current filing system are to be closed.
              The command *Close, and BASIC CLOSE#0 use this.

  SWI OS_FSControl with r0 = 22, which indicates all files on ALL
              filing systems are to be closed.
              The command *Shut uses this.

When a mass close is detected, a prompt will be issued so that
you are aware of a potential problem...

If the Desktop is running, an error box from StopClose0 will show:
  <taskname> attempting to close all open files in <filingsystem>.
  with Allow, Ignore and Fail buttons.

If single-tasking, the prompt will be:
  StopClose0 detected attempt to close all open files in <filingsystem>
  Press I to Ignore, A to Allow, else it will fail:

If Ignored, the close is simply ignored, and the calling program will
continue.

If Allowed, all open files will be closed as 'normal', and the calling
program will continue - which could be dangerous.

If Failed, an error will be raised and passed back to whatever
invoked the close (so you may see the message again).

On System CloseDown, the module is deactivated in case the
closedown process does a Close All as a last resort,
although I am not sure this is required.

If/When there is agreement that failing these requests does not
cause any problems, the prompts could be removed and they would
always fail.

Note that StopClose0 partially works with the *ShutDown command -
although the prompt is issued for the current filing system, a Fail
response does not stop all open files being closed individually.

If you have any comments of queries, please contact me.
Martin Avison
riscos@avisoft.f9.co.uk

History
-------
v0.01 (10 Sep 2018) Initial version.
v0.02 (10 Dec 2018) Added Task & FS to message.
                    Made non-desktop better.
v0.03 (11 Aug 2019) Added FSControl,22 trap and other improvements.
v0.04 (20 Oct 2019) Added Ignore option.
