January 2008
ERSATZ devices are defined in one or more ersatz definition files, each of which is activated by a corresponding ERSATZ= statement in the miame.ini. By convention, these files are stored in the DSK0:[1,4] directory, with the first (and main) one being called ERSATZ.INI. If there are additional ersatz definition files, these are typically named xxxxx.ERZ where xxxxx is some kind of helpful allusion to the source or nature of the definitions contained in that file.
Each ersatz definition file consists of lines with the following format:
ersatz-device: =real-device:{[p,pn]}
ersatz-device
the name of the ersatz device being defined: one to ten alphabetic or numeric characters, starting with an alphabetic character, and immediately followed by a colon.
real-device
the name of a "real" device, defined via a DEVICE statement in the miame.ini file. It must be immediately preceded by the equals (=) symbol, and immediately followed by the colon. The real device names must be three or four alphabetic characters, followed by one or two numeric digits, with a maximum length of five combined characters.
[p,pn]
an optional directory. If not included, then the ersatz device name can be used just like a real-device name in file specifications, meaning that you can optionally include a [p,pn] at that time.
Whenever A-Shell attempts to decode an AMOS-style filespec, it compares the device part of the specification against the ersatz definitions first, before then comparing against the DEVICE definitions from the miame.ini file. So it is actually possible to "redirect" a real device by redefining it as an ersatz. For example, the ersatz definition DSK1:=DSK0: would effectively redirect all DSK1: references to DSK0:, even if DSK1: was a real device.
If the device is not found in either the list of ersatz definitions or real device definitions, then the last loaded ersatz file (i.e. the one referenced in the last ERSATZ= statement in the miame.ini) will be reloaded, assuming that a minute has passed since the last time it was reloaded. So you can effectively add ersatz definitions without re-launching A-Shell, although the value of this is limited since re-launching A-Shell only takes a few seconds.
Examples
Valid ersatz file entries look like this:
SYS:=DSK0:[1,4]
LIB: =DSK0:[7,0]
DSK100: =DSK99:
AA12345678:=ZZZ12:[345,678]
The ersatz definition file that is distributed with A-Shell and invoked by default, ERSATZ.INI, looks like this:
OPR:=DSK0:[1,2]
SYS:=DSK0:[1,4]
DVR:=DSK0:[1,6]
CMD:=DSK0:[2,2]
LIB:=DSK0:[7,0]
HLP:=DSK0:[7,1]
BOX:=DSK0:[7,2]
BAS:=DSK0:[7,6]
SBX:=DSK0:[7,6]
MAC:=DSK0:[7,7]
ASHCFG:=DSK0:[1,7]
PTR:=DSK0:[1,7]
ASHLPD:=DSK0:[1,25]
FAXWRK:=DSK0:[1,26]
ASHBAS:=DSK0:[907,6]
ASHINC:=DSK0:[907,16]