Dustbin  -  Desktop garbage collector

by Spencer, Calcraft and Wrigley

The RISC User Desktop Dustbin was first published a number of years ago and has proved to be very popular. If you use it regularly instead of deleting files as a matter of course, it can be a lifesaver if you suddenly realise that the file you trashed was the wrong one - all you need to do is retrieve it from the rubbish bin.

But there is another very worthwhile advantage in using a dustbin. From RISC OS 3 onwards, if you ask the Filer to move a file from one place to another on the same disc, then it will simply be renamed rather than physically moved. Since the Dustbin can make use of this facility, this greatly speeds up the process of trashing large directories or applications, since only the top-level directory needs to be renamed. This means that trashing such an object doesn't take up valuable time while you're working, and the files can be emptied from the bin later at your leisure, or when the Dustbin is next started up.

Unfortunately with the expansion of computer systems, many users now have more than one hard disc or partition, and so using a dustbin over a multi-drive system will meet the old problem of having to physically move trashed files unless they're on the same disc and partition as the Dustbin application. This new version overcomes the problem by providing local rubbish bins for each hard drive. Files dragged to the Dustbin are routed to the appropriate rubbish bin, and thus only a rename operation is required. The program will even work over a network, so if for example you have two or more machines connected via Access, you can trash files on another machine without having to fetch them over the network.

The new version has several other improvements as well. The original program always emptied its bin every time it started up, but this is now an optional function. There is also an option to disable operation over a NetFS network in case you are worried about security of files on remote stations. This still allows Accessed machines to work.

Using the Dustbin
Dustbin cannot be used directly from the floppy disc but must be transferred to a suitable location on your hard disc. If you wish to use the application with multiple drives or partitions, then you must set up the appropriate rubbish directories first as follows:

1. On each drive, create a directory which will contain the trashed files. This can be anywhere and have any name, but you will probably find it handy to call it Rubbish and place it somewhere with other miscellaneous utilities.

2. Now load the file Bins which is inside the !Dustbin application directory into an editor. The file currently has one line: <Rubbish$Dir>.Rubbish. This is the default rubbish directory which resides inside the application and is used for files on the same disc as the application and also for files on any disc which does not have its own rubbish directory, e.g. floppies.

3. Add the full pathnames of all the extra rubbish directories you have created to the file, one line for each path. Now save the file back into the application directory.

The application can now be run in the usual way by double-clicking on its icon in the Filer window. An icon is installed on the icon bar. The icon bar menu has 4 options: Info, Empty, Choices and Quit. Info and Quit perform their usual functions.

The Empty option will empty all the rubbish directories by wiping any files in them. This is non-recoverable, so make absolutely sure you don't want any of the files before doing this. The Choices option leads to a dialogue box allowing you to set two options. The first of these indicates whether Dustbin should empty its bins each time it starts up. By default it will do so. The second option allows you to enable operation for any disc whose name starts with "Net". If you are running a network and you are happy that other people's files are secure from unauthorised trashing, you can set this option. Operation on discs whose name starts with "Share" is unaffected by this, so you can use the Dustbin over an Access network at all times.

Please note that these two options will only come into force next time you run the program.

Dragging any file or directory to the Dustbin will remove it from its original location and place it in the bin. Provided there is a rubbish bin specified on the same drive as the source, then the object(s) will simply be renamed and will now be located in the bin. If no bin exists for that drive, then the objects will be physically moved into the default bin. When there are files in the bin, the icon bar icon will change to indicate that the bin is full.

Clicking Select over the icon bar icon opens Dustbin's window. This shows any files that are currently in any of the rubbish bins, although it does not indicate which bin they are in. Files may be dragged out of this window into a directory viewer, and will thus be 'untrashed'. Clicking Menu over the window opens a menu with a single Empty option that works exactly as the identical option from the icon bar menu.

 Copyright RISC User Magazine 1996
