IUP Computer Science
CO 300 Spring 2000

Project #4
(due 5 pm March 29)

All sorts of things on VMS system have logical names (names, usually simple ones, that can be used to refer to something that has a very complicated real name). There are literally thousands of logical names defined; they are stored in tables and translated, usually automatically, to the real name on an as-needed basis.

Your task for this project is to prompt the user at the keyboard for a name, to assume that the name is a logical name and translate into its "equivalence name" (the real name of whatever it is), and then to display some information about whatever the name refers to. Here are the specifics of what your program should do.

  1. Prompt for and read in a name. Allow the name to be up to 30 characters in length.
  2. Translate the name, using the $TRNLNM_S system macro, into an equivalence name, getting the name of table the name was found in as part of the action. If the name did not translate, display an error message; otherwise, display the equivalence name and the table name. Allow for at least 50 character equivalence names and 30 character table names.
  3. Examine the equivalence name and determine whether it is a directory, a device, or an e-mail username. If it is a directory, have the program perform a DIRECTORY command on it and display the results on the screen. If it is a device, have the program perform a SHOW DEVICE command on it and display the results on the screen. If it is an e-mail username, have the program perform FINGER on the user and display the results on the screen. To perform one of these commands, use the $SPAWN macro described on the back.
  4. If the equivalence name cannot be determined to be a directory, device or e-mail username, the program should display a message saying "No more information is available." Some logical names translate to be files, queues, numbers, character strings, key sequences, Internet addresses, or other logical names. These are the objects for which you should indicate "No more information is available."
  5. Repeat all of this until the name entered at the prompt is blank. That is, until only Enter is pressed for the name.

You must use LNM$FILE_DEV as the list of table names to search for the logical name. LNM$FILE_DEV is the top-most list of logical name tables; by using it, you are sure of finding the name if it exists in any logical name table. Also, some logical names (such as DISK$LOGIN) translate to two or more equivalence strings. Don't worry about such situations. You are required only to display one equivalence name (the first) for each logical name.

EXTRA CREDIT

For extra credit, on any name that is determined to be a device, use the $GETDVIW_S system macro to determine what kind of device it is - disk, tape, or terminal. (You cannot easily determine if a device is a printer.) Display a message like, "Device is a disk." just before performing the SHOW DEVICE command. Use similar messages for the other types of devices. If $GETDVIW_S cannot tell you what type of device it is, display "Unknown device type" before performing the SHOW DEVICE command.

Handin in a .LIS printout of your program on greenbar paper. Also, hand in the CARBON captured output from running your program and entering the following names.

both
disk$login
tt
jim_wolfe
project
lans
decw$utils
300lib
disk$develop
mumble
john_carr
mua

The $spawn macro is part of the iopack library file. It is available for use in any program that contains the PROJECT:IOPACK library. The form of $spawn is

     $spawn  [command] [infile]
where command is a reference to a fixed length string descriptor of a DCL command and infile is a reference to a fixed length string descriptor of a file specification in which DCL commands can be found. Thus, $spawn can be used to execute a single DCL command while inside a program; or it can be used to execute the entire collection of commands from a file (a .COM) file. Both arguments to $spawn are optional; you should use one or the other, not both. For this program, I would think you would use the command argument, since you don't know how to create a .COM file in assembly language.

NOTE: The names mua and lans are defined by me. If, when you try to run your program, those names do not translate as logical names, let me know immediately. The method I used to define them may be affected by system reboot actions. If these names are not defined, I can redefine them.