This is a simple, small (820 byte), 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. It may be of use during development, or when there are suspicions of something closing all files accidentally.
It will trap all instances of the command *Close, and in BASIC CLOSE#0, indeed anything that uses aSWI OS_Find with r0 and r1=0, which indicates all files on the current filing system are to be closed.
It will also trap all instances of the command *Shut, or anything which uses SWI OS_FSControl with r0 = 22, which indicates all files on ALL filing systems are to be closed.
In these cases, a prompt will be issued so that you are aware of a potential problem:
<taskname> attempting to close all open files in <filingsystem>
with options to Fail or Allow, whether in the Desktop or single-tasking.