AmigaOS 4.0 - About OS4 - Commands
|
||||||||||||
|
||||||||||||
|
ASSIGN allows directories to be referenced via short, convenient logical device names rather than use their usual
names or complete paths. The ASSIGN command can create assignments, remove assignments, and list some or all current
assignments, but ASSIGN is not used for and does not show so-called "pseudo-assigns"
which are new to OS4.
If the <name> and {<target>} arguments are given, ASSIGN will assign the given name to the specified target. Each time the assigned logical device name is referred to, AmigaDOS will access the specified target(s). 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 target to that logical device will be cancelled. You can assign several logical device names to the same directory by using multiple ASSIGN statements. Alternatively you can tell the ASSIGN command to read a list of specifications from a file using the FROM <from> argument. In that file, there must be one assignment specification per line; lines beginning with the ';' character are ignored. The file could look like this: LIBS: SYS:Libs BigAssem:Libs PDAssem:Libs WorkDisk: DF0: DEFER C: DF0:C PATH To complement the FROM argument there is the TO <to> argument which will store the current list of assignments in a file, suitable for use with the FROM argument. You can assign one logical device name to several targets by specifying each file or directory after the <name> argument or by using several ASSIGN commands with 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 specify the <name> followed by the the REMOVE option. It must be noted that this technique cannot be used to cancel an ASSIGN; instead yo must specify only the <name> argument as discussed above. PLEASE NOTE: A long-standing error within ASSIGN which permitted the REMOVE argument without the target argument, i.e. ASSIGN name: REMOVE, was corrected in Update #4. Statements using that syntax are no longer valid syntax and will fail; they must be changed to ASSIGN name: instead. This was commonly used in installation scripts and could affect other scripts which previously worked. New to Update#4 are the FROM=<from> and TO=<to> arguments, but we don't really understand how they work at this time so rather than give you bad advice we'd rather wait until we are fully conversant with their workings. If no arguments are given with ASSIGN, or if the 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 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 different disk disk in DF0: at the time the FONTS: directory is needed, the system will associate FONTS: with that particular disk. If you remove that disk and insert another containing a FONTS: directory, the system will specifically request the other 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 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 the option may cause a software failure. Example 1: Example 2: Volumes: OS4 [Mounted] OS4Work [Mounted] RAM Disk [Mounted] Directories:
Example 3: FONTS: MyFonts:Fontdir Example 4: Example 5: Example 6: 3.OS4:> ASSIGN WorkDisk: EXISTS WorkDisk <DF0:> Example 7: 3.OS4:> ASSIGN C: EXISTS C [DF0:C] Example 8: Example 9: 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. |
||||||||||||