During MS-DOS days, an Undelete command existed and provided three levels of protection. Sentry is pretty much the same as the Recycle Bin, it moves deleted files to a directory called Sentry. Tracker used a hidden file named PCTRACKR.DEL to record the location of deleted files and regular undelete. The first two level of protection required disk space which is understandable and also an amount of RAM (13.5 Kb). Why is that since I believe, and I am not entirely sure, that the Recycle Bin does not require any memory.
UNDELETE relies only on the standard MS-DOS deletion behaviour: when a file is deleted, the first character of its file name is replaced with a deletion marker, and its clusters are freed.
UNDELETE does all its magic when undeleting, with no prior preparation.
“Sentry” and “Tracker” modes modify this deletion behaviour; to do this, a terminate-and-stay-resident program is installed, and calls to DOS’ deletion functions are intercepted and handled by this program. That’s where the additional memory requirement comes from: it’s extra code (and associated data) effectively added to the operating system to enable these features. Under DOS, this was significant — every kilobyte of memory in the first megabyte was precious! So choosing between better protection and more memory wasn’t necessarily straightforward.
UNDELETE (a subset of Central Point Software’s PC Tools’
DATAMON) occupies 13.5KiB of memory in sentry mode, 9.5KiB in tracking mode. That may seem like a lot, but the resident portion has to take care of quite a few different features, including:
- intercepting deletion, of course, to provide whichever protection has been requested
- providing an installation check (on interrupt 0x16 and interrupt 0x2F), and other run-time services (e.g. to query the current status)
- intercepting DOS calls dealing with free disk space (so that “deleted” files don’t appear to occupy disk space)
- intercepting DOS calls dealing with errors (to act on “out of disk space” errors by deleting protected files)
- protecting the
SENTRYdirectories (in sentry mode)
Looking at the resident portion, it seems it would have been possible to make it smaller, but it’s not as simple as one might imagine at first glance.
Under Windows, supporting the Recycle Bin also uses memory, but the impact is far less significant in practice, so enabling it by default isn’t a concern.