[AmigaOS 3.1 Command Reference\Resident]
Format: RESlDENT [<resident name>] [<filename>] [REMOVE]
[ADD] [REPLACE] [PURE|FORCE] [SYSTEM]
Template: NAME, FlLE, REMOVE/S, ADD/S, REPLACE/S, PURE=FORCE/S,
Purpose: To display and modify the list of resident commands.
RESIDENT is used to load commands and add them to the resident list
maintained by the Shell. This allows the command to be executed without it
having to be reloaded from disk each time. This eliminates the time it takes
to load the command and reduces memory use when multitasking.
To be made resident, a command should be both re-entrant and re-executable.
A re-entrant command can properly support independent use by two or more
programs at the same time.
A re-executable command does not have to be reloaded to be executed again.
Commands that have these characteristics are called pure and have the p
(pure) protection bit set.
LIST the C: directory to check for the presence of the p protection bit to
determine which commands are pure.
Many of the commands in the C: directory, as well as the MORE command in
Utilities, are pure commands and can be made resident. If a command does
not have its pure bit set, it probably cannot be made resident safely.
(Just setting the pure bit does not make a command or program pure).
The REPLACE option is the default option and does not need to be explicitly
stated. If RESlDENT is invoked with no options, it lists the programs on the
resident list. If no <resident name> is specifed (i.e., just a filename is
specified), RESIDENT will use the filename portion as the name on the
resident list. The full path to the file must be used.
If a <resident name> is specified and RESIDENT finds a program with that
name already on the list, it will attempt to replace the command. That
<resident name> must then be used to reference the resident version of the
command. The replacement will succeed only if the already-resident command
is not in use.
To override REPLACEment and make several versions of a command resident
simultaneously, use the ADD option, giving a different <resident name> for
each version loaded.
If the SYSTEM option is specified, the command will be added to the system
portion of the resident list. Any commands added to the resident list with
the SYSTEM option cannot be removed. To list SYSTEM files on the RESlDENT
list, you must specify the SYSTEM option.
The PURE option forces RESIDENT to load commands which are not marked as
pure (i.e., they do not have their pure bit set), and can be used
experimentally to test the pureness of other commands and programs.
Use the PURE option with caution. Remember that in order for a command to be
made RESlDENT, it must be both re-entrant and re-executable. Although it is
unlikely, some of your prog-rams may be pure enough to be fully re-entrant
and usable by more than one process at the same time. Other programs may not
be fully re-entrant but may be pure enough to be re-executable. Such
commands can be made RESIDENT, but you must be extremely careful to use the
command in only one process at a time.
The availability of Internal commands can also be controlled with RESIDENT.
To deactivate an Internal command (for example, if an application has its
own command of the same name), use RESIDENT <Command> REMOVE. AmigaDOS will
no longer recognize the Internal command. The AmigaDOS command can be
reactivated with the REPLACE option.
1> RESIDENT C:COPY
Makes the COPY command resident (replaces any previous version).
1> RESIDENT Copy2 DF1:C/COPY ADD
Adds another version of COPY to the resident list, under the name Copy2.
1> RESIDENT Xdir DF1:C/Xdir PURE
Makes an experimental, non-pure version of the DIR command resident.
1> RESIDENT CD REMOVE
Makes the Internal CD command unavailable.
1> RESIDENT CD REPLACE
Restores the CD command to the system.
Converted from AmigaGuide to HTML by Matt Owen