Scrap Check  -  Checks for full scrap directories

by Alan Wrigley

Many applications make use of the Scrap directory to store temporary files, but not all are well behaved about the way in which they remove unwanted files. It can often happen that a Scrap directory becomes full (i.e. contains the limit of 77 files), and when an application tries to write to the full directory it will not always be obvious that something is going wrong. You will not always see an error, and so you are left with a process which is apparently not working properly, but you have no idea why.

ScrapCheck helps to overcome this problem by checking all your Scrap directories to see whether any of them are becoming dangerously full. It is most useful as part of your boot sequence, so that the checks are made regularly, but you can run the program at any time. It will issue a warning if your Scrap directory (i.e. the one specified by Wimp$ScrapDir) or any of its subdirectories contain more than 60 objects.

The program quits as soon as it has checked all the directories, with a message to indicate what it has found. If everything is OK the message reads "Scrap directories checked". If any are found to have more than 60 objects, the message will be "Please check your scrap directories and delete unwanted files". The latter message is always issued if appropriate, but if you're running the program from a boot sequence you don't want the sequence to be interrupted by a message telling you everything is OK. ScrapCheck will therefore suppress the OK message if the parameter -quiet is included in the command string. Note that this must be given in full, and must not be abbreviated to -q. So your boot sequence would include a line such as:

Run <path>.!ScrapChck -quiet

where path is the pathname of the directory in which the application is located.

 Copyright RISC User Magazine 1996
