ASSIGN
Format: ASSIGN [<name>: {dir}] [LIST] [EXISTS] [DISMOUNT] [DEFER]
[PATH] [ADD] [REMOVE] [VOLS] [DIRS] [DEVICES]
Template: NAME, TARGET/M, LIST/S, EXISTS/S, DISMOUNT/S, DEFER/S,
PATH/S, ADD/S, REMOVE/S, VOLS/S, DIRS/S, DEVICES/S
Purpose: To control assignment of logical device names to file
system directories.
Path: C:ASSlGN
Specifcation:
ASSIGN allows directories to be referenced via short, convenient logical
device names rather than their usual names or complete paths. The ASSIGN
command can create assignments, remove assignments, or list some or all
current assignments.
If the <name> and {dir} arguments are given, ASSIGN will assign the given
name to the specified directory. Each time the assigned logical device name
is refered to, AmigaDOS will access the specified directory. If the <name>
given is already assigned to a directory, the new directory will replace the
previous directory. (Always be sure to include a colon after the <name>
argument.)
If only the <name> argument is given, any existing ASSIGN of a directory to
that logical device will be cancelled.
You can assign several logical device names to the same directory by using
multiple ASSIGN commands.
You can assign one logical device name to several directories by specifying
each directory after the <name> argument or by using the ADD option. When
the ADD option is specified, any existing directory assigned to <name> is
not cancelled. Instead, the newly specified directory is added to the ASSIGN
list, and the system will search for both directories when <name> is
encountered. If the original directory is not available, ASSIGN will be
satisfied with the newly added directory.
To delete a name from the ASSIGN list, use the REMOVE option.
If no arguments are given with ASSIGN, or if the LIST keyword is used, a
list of all current assignments will be displayed. If the VOLS, DIRS, or
DEVICES switch is specified, ASSIGN will limit the display to volumes,
directories, or devices, respectively.
When the EXISTS keyword is given along with a logical device name, AmigaDOS
will search the ASSIGN list for that name and display the volume and
directory assigned to that device. If the device name is not found, the
condition flag is set to 5 (WARN). This is commonly used in scripts.
Normally, when the (dir) argument is given, AmigaDOS immediately looks for
that directory. If the ASSIGN commands are part of the Startup-Sequence, the
directories need to be present on a mounted disk during the boot procedure.
If an assigned directory cannot be found, a requester appears asking for the
volume containing that directory. However, two new options, DEFER and PATH,
will wait until the directory is actually needed before searching for it.
The DEFER option creates a "late-binding" ASSIGN. This ASSIGN only takes
effect when the assigned object is first referenced, rather than when the
assignment is made. This eliminates the need to insert disks during the boot
procedure that contain the directories that are assigned during the Startup-
Sequence. When the DEFER option is used, the disk containing the assigned
directory is not needed until the object is actually called upon. The
assignment remains in force until explicitly changed.
For example, if you ASSIGN FONTS: to DF0:Fonts with the DEFER option, the
system will associate FONTS: with whatever disk is in DF0: at the time FONTS:
is called. If you have a Workbench disk in DF0: at the time the FONTS:
directory is needed, the system will associate FONTS: with that particular
Workbench disk. If you later remove that Workbench disk and insert another
disk containing a FONTS: directory, the system will specifically request the
original Workbench disk the next time FONTS: is needed.
It is not necessary for the assigned name to retain the name of the
directory nor is it necessary for it to be uppercase. For example, both
CLIPS and Clips can be assigned to the Ram Disk:Clipboards directory.
The PATH option creates a "non-binding" ASSIGN. A non-binding ASSIGN acts
like a DEFERred ASSIGN except that it is re-evaluated each time the assigned
name is referenced. This prevents the system from expecting a particular
volume in order to use a particular directory (such as the situation
described in the example above).
For example, if you assign FONTS: to DF0:Fonts with the PATH option, any
disk in DF0: will be searched when FONTS: is referenced. As long as the disk
contains a FONTS: directory, it will satisfy the ASSIGN. You cannot assign
multiple directories with the PATH option.
The PATH option is especially useful to users with floppy disk systems as it
eliminates the need to reinsert the original Workbench disk used to boot the
system. As long as the drive you have assigned with the PATH option contains
a disk with the assigned directory name, the system will use that disk. The
DISMOUNT option disconnects a volume or device from the list of mounted
devices. It does not free up resources; it merely removes the name from the
list. There is no way to cancel a DISMOUNT without rebooting. DISMOUNT is
primarily for use during software development. Careless use of this option
may cause a software failure.
Example 1:
1> ASSIGN FONTS: MyFonts:Fontdir
Assigns the FONTS: directory to Fontdir on MyFonts:.
Example 2:
1> ASSIGN LIST
Volumes:
Ram Disk [Mounted]
Workbench [Mounted]
MyFonts [Mounted]
Directories:
LOCALE Workbench:Locale
KEYMAPS Workbench:Devs/Keymaps
PRINTERS Workbench:Devs/Printers
REXX Workbench:S
CLIPS Ram Disk:Clipboards
ENV Ram Disk:Env
T Ram Disk:T
ENVARC Workbench:Prefs/Env-Archive
SYS Workbench:
C Workbench:C
S Workbench:S
L Workbench:L
FONTS MyFonts:Fontdir
DEVS Workbench:Devs
LIBS Workbench:Libs
Devices:
PIPE AUX RAM CON
RAW PAR SER PRT DF0 DF1
Shows a list of all current assignments.
Example 3:
1> ASSIGN FONTS: EXISTS FONTS: MyFonts:FontDir
Is an inquiry into the assignment of FONTS:. AmigaDOS responds by showing
that FONTS: is assigned to the FontDir directory of the MyFonts volume.
Example 4:
1> ASSIGN LIBS: SYS:Libs BigAssem:Libs PDAssem:Libs
Is a multiple-directory assignment that creates a search path containing
three Libs directories. These directories will be searched in sequence each
time LIBS: is invoked.
Example 5:
1> ASSIGN DEVS: REMOVE
Removes the DEVS: assignment from the system.
Example 6:
1> ASSIGN WorkDisk: DF0: DEFER
1> ASSIGN WorkDisk: EXISTS WorkDisk: DF0:
Sets up a late-binding assignment of the logical device WorkDisk:. The disk
does not have to be inserted in DF0: until the first time you refer to the
name WorkDisk:. Notice that ASSIGN shows DF0: enclosed in angle brackets to
indicate that it is DEFERred. After the first reference to WorkDisk:, the
volume name of the disk that was in DF0: at the time will replace <DF0:>.
Example 7:
1> ASSIGN C: DF0:C PATH
1> ASSIGN C: EXISTS WorkDisk DF0:
Will reference the C directory of whatever disk is in DF0: at the time a
command is searched for. Notice that ASSIGN shows DF0:C in square brackets
to indicate that it is a non-binding ASSIGN.
Example 8:
1> ASSIGN LIBS: ZCad:Libs ADD
Adds ZCad:Libs to the list of directories assigned as LIBS:.
Example 9:
1> ASSIGN LIBS: ZCad:Libs REMOVE
Removes ZCad:Libs from the list of directories assigned as LIBS:.
Converted from AmigaGuide to HTML by Jaruzel