Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

BENCHTRASH Obsolete
Purpose: To provide a global "Trashcan" icon on the workbench screen.
Format: BENCHTRASH [NAME <name>] [ICON <path>] [FULLICON <path>] [NEWTRASHICON <path>] [ICONX <coordinate>] [ICONY <coordinate>] [MODE DELETE | MIXED | LOCAL | GLOBAL] [CLEANUP ON | OFF] [COPYFIRST ON | OFF] [CLEANUPDELAY <seconds>] [MAXAGE <days>] [CENTER ON | OFF] [PROGRESSBAR ON | OFF] [DONOTASK ON | OFF] [SILENTDROP <num>] [NOACTIVATE YES | NO] [DONECMD <command>] [TRASHDIR <dir>] [LOCALTRASHDIR <dir>] [TRASHPATTERN <pattern>] [DELETEFORWB ON | OFF] [EJECT {<drv>=<command>}]
Template: NAME, ICON, FULLICON, NEWTRASHICON, ICONX/N, ICONY/N, MODE/K, CLEANUP/K, COPYFIRST/K, CLEANUPDELAY/N, MAXAGE/N, DELETEFORWB/K, HELP/S, CENTER/K, PROGRESSBAR/K, DONOTASK/K, SILENTDROP/K, NOACTIVE/K, DONECMD, TRASHDIR, LOCALTRASHDIR, TRASHPATTERN, NEWICONS/S, EJECT/M
Path: SYS:Tools/BenchTrash

This command became obsolete with AmigaOS 4.0 Final - details shown for information only

BENCHTRASH creates a global "Trashcan" icon on the workbench screen. Icons dropped over it will be either deleted on request, or are moved to the "Trashcan" drawer on the disk they are located on. In addition, BenchTrash tries to eject a disk if its icon is dropped over it.

NAME <name> specifies the title of the icon to appear under the trashcan. Defaults to "BenchTrash".

ICON <path> specifies the path of the icon, without ".info", to use on the workbench screen. Defaults to the standard trashcan icon.

FULLICON <path> specifies the path to an icon, without ".info", for a "full" trashcan. If given and BENCHTRASH detects a full trashcan, it displays this icon alternately with the icon specified by the ICON option for an empty trashcan (or default). BENCHTRASH checks the state of the trashcan(s) every time it gets activated, i.e. either when an icon gets dropped into it, or when you double-click on it.
WARNING: The FULLICON option is not without its quirks. First, if the trashcan MODE is set to DELETE, BENCHTRASH will never display the "full" icon. If the mode is MIXED or LOCAL, BENCHTRASH will check the "Trashcan" directories of the available volumes and adjust the icon if required. However, this check will not be performed if disks are inserted or removed, or if you drop an icon directly into the trashcan drawer of a volume or cleanup the trashcan manually. BENCHTRASH is simply not able to detect these changes and hence won't be able to adjust its icon if this happens. If the mode is GLOBAL, BENCHTRASH checks the global trashcan directory for the state information. One of the problems when exchanging the icon is that the position of the icon is not available and BENCHTRASH might not be able to display the new icon at the same position as the old one, i.e. the icon may jump. This is the failure of the Workbench, there's nothing that can be done to fix it.

NEWTRASHICON <path> specifies the path to an icon, without ".info", to be used if BENCHTRASH has to create a new Trashcan drawer. Defaults to the standard trashcan icon.

ICONX <coordinate> specifies the horizontal position where the BenchTrash icon should be placed. By default, this will be on the left side of your Workbench screen.

ICONY <coordinate> specifies the vertical position where the BenchTrash icon should be placed. By default, this will be the bottom of your Workbench screen.

MODE <mode> specifies what to do with icons dropped on top of the BenchTrash.

  • <mode> DELETE, means they get deleted - asking the user first, of course.
  • <mode> LOCAL, means these files get moved to the local trashcan of the volume they are stored on. BENCHTRASH will ask you to create a trashcan on that volume if it's missing. You've to empty these trashcans manually from time to time, probably using the workbench menu.
  • <mode> MIXED is a mixture of both modes: Files are moved to the trashcan if present, but deleted otherwise. Files that are already IN the trashcan are also removed. Here, again, the user is asked first for confirmation, but only for those files that get deleted.
  • <mode> GLOBAL selects a global trashcan directory where all "trashed" files get stored. This directory can be cleaned up automatically from time to time by BENCHTRASH. It is "SYS:Trashcan" by default, but the trashcan drawer can be changed, of course. BE WARNED: By selecting this option, your harddisk gets FULLER by deleting items! Make sure enough room is available.
Another warning: BENCHTRASH invents unique names if you try to move a file or a drawer into the global trashcan that already exists there. BENCHTRASH adds an underscore and a number, starting with one, to get a unique name. This is, by deleting two files named "Calc", you'll end up with "Calc" and "Calc_1" in the trash directory. The next "Calc" deleted will be renamed to "Calc_2" and so on.

CLEANUP ON specifies that BENCHTRASH must look into the global trashcan drawer on startup and will delete files that are older than a certain amount of days. THIS WORKS ONLY for the drawer that was specified as global "trashdump", not for the trashcan directories of individual volumes. The default is OFF, in which case you can use the workbench menu to empty the trashcan.

COPYFIRST controls the way that BenchTrash copies files to the global trashcan. If COPYFIRST ON is specified, the complete set of data is copied first, and then, in a second step, the data is erased from its original place. This is safest because no data loss can occure, but your HD must be big enough to store the complete set of files AT LEAST TWICE. It might also defragmentate your HD somewhat, but an unexpected failure while copying the files won't affect the data because the original is still kept. The default is COPYFIRST OFF, which means that the copied files will be deleted immediately, hence leaving more space on the HD. While this is quicker and needs less storage, it is also less safe because an error condition while deleting the files will end in one piece of the data in the trashcan and the not yet copied part at the original place. It is then up to you to restore the original data sets. Remember, this setting makes only sense if GLOBAL is set to TRUE as well.

If CLEANUP ON has been specified, CLEANUPDELAY <seconds> specifies the delay in seconds between launching BenchTrash and cleaning the global trashcan. Defaults is 10 seconds. The cleanup task runs at priority -1, so tries to stay friendly in the background. It requires an exclusive access to the trashcan directory, so you can avoid or delay the deletion process simply by opening the trashcan drawer. BENCHTRASH will then come back every minute to check whether it is now able to clean up this directory.

If CLEANUP ON has been specified, MAXAGE <days> specifies the maximum age in days of the files to be kept in the global trashcan directory. Files older than MAXAGE are erased as part of the startup process of BENCHTRASH, and only done ONCE each time you boot the computer. Default is 7 days.

CENTER ON specifies that BENCHTRASH will center its setup window on the Workbench screen. Default is CENTER OFF, placing it in the upper left corner.

PROGRESSBAR ON specifies that BENCHTRASH should display a progress bar about how far it has got with deleting files. An "Abort" button is present, too, to cancel the process. Closing the window with the status bar aborts the deletion also. Default is PROGRESSBAR OFF.

DONOTASK ON specifies that the "confirmation" requester is to be suppressed and the files are always deleted. THIS MIGHT BE QUITE DANGEROUS!. Default is DONOTASK OFF which shows a requester.

If DONOTASK ON has NOT been specified, SILENTDROP <num> specifies the number of files or directories up to which BenchTrash will not show a confirmation requester and will delete the files silently. E.g. if this is set to "2", more than two files must be dropped on the BenchTrash to get the confirmation requester, less files will be deleted without asking first. The default for this option is "0", i.e. show the requester regardless of the number of files. This option has no effect if DONOTASK ON is specified.

NOACTIVATE ON tells BENCHTRASH not to activate its progress bar on open. The default is to activate it.

DONECMD <command> specifies a standard Amiga Shell command line that will be executed every time BENCHTRASH finishes its work.

If MODE GLOBAL has been specified, TRASHDIR <dir> specifies the FULL path to the directory to be used as global trashcan. Default is "SYS:Trashcan".

If MODE GLOBAL has NOT been specified, LOCALTRASHDIR <dir> specifies a path relative to a volume, to be used as local trashcan of that volume. Defaults is "Trashcan". This directory must lie in the root directory of all volumes and will be used as "ordinary" trashcan directory.

If neither MODE GLOBAL or LOCALTRASHDIR <dir> have been specified, TRASHPATTERN <pattern> specifies a file pattern BENCHTRASH will use to scan for local trashcans. It will check all directories that match this pattern. If a directory is found that comes with a valid "Trashcan" type icon, this directory is used as replacement. However, since the disk must be scanned for this operation, it will be usually much slower.

If NEWICONS is specified, BENCHTRASH will try to use the "newicon" library to display the trashcan image in its window.

EJECT <drv>=<command> specifies a device together with a command that will be executed if an EJECT request for the drive is requested. For example:

EJECT DF0=EjectDisk df0: will call the "EjectDisk" program whenever a disk in DF0: must be ejected. BenchTrash cannot do this ejection itself, since there is no standard way to do it!

Starting with release 1.08, DiskSafe can also recognize ejectable drives by the exec device and unit number. Insert a slash "/" instead of a equal sign and give the exec device name behind it, replace "device" by the unit number. The example above is *almost* (if you don't use the MultiFileSystem) equivalent to:

EJECT trackdisk.0/EjectDisk df0: Note again that the "device" string is not added - this is done by BenchTrash.

A very common usage is to eject a IOMega "ZIP" floppy with Oliver Hitz's ZipTools or ZJTools (can be found on Aminet "ZipTool.lha"):

EJECT ZIP=ZipTool >NIL: EJECT ZIP: Please note that you must give the name of the DEVICE, not of volumes, i.e. "DH0" instead of "Workbench" or "SYS".

If your SCSI device driver is called "oktagon.device" and the ZIP is set to SCSI unit 6, the line above is *almost* equivalent to:

EJECT oktagon.6/ZipTool >NIL: EJECT ZIP: (The *almost* is related to the fact that you may have in principle two dos device drivers mounted on the same piece of hardware - also you shouldn't do this!)

Wildcards have been introduced to BenchTrash. It is now also possible to match complete classes of devices. Here one example:

EJECT DF?=EjectDisk %S: The "?" is a standard AmigaDOS pattern, a place holder for a single character. Hence all device names of three characters starting with "df" will get the same ejection command. The "%S" in the last line is replaced by the full device name without a colon (":"). If, for example, you drag the disk "df0:" into the BenchTrash, the command being executed will be: EjectDisk df0: Another example using exec devices: EJECT #?scsi.#?/SCSIEject %S %N All exec device names ending with "scsi" will match, i.e. "scsi.device" or "gvpscsi.device". Since the unit ID is replaced by the pattern "#?", the unit of the device does not matter. The "%S" is replaced by the exec device name, hence "scsi.device" or "gvpscsi.device", the "%N" is replaced by the unit number as an ASCII string.

If you need the percent sign itself in the ejection command for whatever reason, escape it with another percent sign, i.e. the pattern "%%" is replaced by "%":

EJECT foo.1/Foo%%Eject %N will match unit one of the "foo.device". The ejection command for the "foo.device" is called "Foo%Eject". The device name and the unit number of exec devices are matched separately, so a pattern like EJECT #?0/FooEject %S %N won't match all devices and units ending with zero (units 0, 10, 20...). Use two patterns instead: EJECT #?.#?0/FooEject %S %N Remember that a ".device" is always appended to the first pattern, so the example above won't match things like "foo.library", although the pattern is just the "match all" wildcard.

Example

3.OS4:> BENCHTRASH

Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: December 24, 2006.