From the NannyMUD documentation
2000-12-16
save_file_cleaner - A tool for disc hygiene.
This object can be found in /std/special/save_file_cleaner/ .
reset decide start_clean
PROPERTY NAME
save_report - Save the report in a file.DESCRIPTION
Set this property to get the report saved to a file 'REPORT.DayMonthYear.txt'.PROPERTY NAME
direct_clean - Start the cleaning directly..DESCRIPTION
Set this property to have the cleaning starting as soon as the cleaner is loaded.
DESCRIPTION
Clubs etc. that uses a savefile to store member-data should have some code that removes savefiles corresponding to players that do not exist any longer, etc. This object does exactly that. USAGE Inherit this file in an object in the dir where you have the savefiles. Then simply load that object, and it will start cleaning at some reset a little later, with a 10% chance that it happens each reset. The object will generate a file, CLEANER.c, overwriting any existing such file. The generated file will contain a report, and some code to do the actual cleaning. Loading it will cause the needed files to be removed. The CLEANER object will destruct itself and remove the its file after it is done removing the other files. If you wish to save the report for later, use the property 'save_report' (see below). A good time to load this object is at reboot, from a wizards castle. The delay between loading and acting will keep down the lag right after reboot. You can of course force the cleaning to start directly after the object loads by calling the cleaning function directly.NOTE
Due to security, this object implements a sub-set of the property functionality; no function calls in any object will be done.
FUNCTION
NAME
reset -SYNTAX
void reset(int arg)DESCRIPTION
This is the common reset function.NOTE
If you re-define the reset function, you should consider carefully what you are doing.
FUNCTION
NAME
decide -SYNTAX
int decide(string name)DESCRIPTION
This function is called once for every savefile, with the name of the savefile as the argument. By returning 1 from this function, the savefile will be included in the list of savefiles that should be removed.NOTE
Savefiles corresponding to non-existing players will be removed even if this function does not return 1 for them.
FUNCTION
NAME
start_clean -SYNTAX
int start_clean()DESCRIPTION
Call this function to force the cleaning to begin. It returns -1 if there's no savefiles to process, else 1.