HPlogo Understanding Your System: HP 3000 Series 9X8LX Computer Systems > Chapter 3 What Are Files?

The File Connection

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

TIP: For the computer, every source of information is a file.

For the computer, every destination for information is a file.

For the computer, groups, accounts and directories are all files.

As curious as it might sound, the computer looks at your keyboard as a file--an input file. And it looks at your video screen as a file, too--an output file.

Devices

Devices such as printers and your terminal (keyboard and video screen, together) belong in the story of files.

From the perspective of the computer, there is very little difference between a printer and a file in which you store information on a disk. Both are destinations for information.

One distinction is critical. You can send information to a disk file and retrieve information from it. But you can only send information to a printer. You cannot retrieve information from it.

Printers and terminals are so strikingly different in their physical operation that the computer does not attempt to "know" how to send information to these different destinations.

Instead, once it determines that information is destined for a printer, the computer passes the information to a system process, often called a device driver. It is the driver process that "knows" how to put information onto paper.

In the same fashion, once it determines that information is destined for your video screen, it passes that information to a different device driver (process), one that "knows" how to put information onto a screen.

In a similar fashion, you might take the blueprints for a house that you want to build and give them to a carpenter or a building contractor who knows how to build houses. If all goes according to plan, you have nothing more to do. The carpenter/contractor "process" takes over, and, following the blueprints, builds a house. Processes and device drivers serve the computer in the same way.

The computer must have a special device driver for each kind of device that it uses--in fact, two printers that operate differently would need different device drivers. This touches on the subject of compatibility, the ability of two different computers to work with each other, or the ability of any computer to work with the devices that are attached to it. If two computers cannot adapt to each other's processes, they cannot communicate.

$STDIN and $STDLIST

Your terminal is, in fact, two files, $STDIN and $STDLIST. That is how the computer sees it.

These files are different from the letter or report that you might write and keep on the disk or print on a printer. These names will appear on your screen if you use the SHOWME command. What you will see looks very much like this:

   :showme

   USER: #S2367,JOHN.FINANCE,REPORTS         (NOT IN BREAK)

   RELEASE...

   CURRENT...

   LOGON:...

   CPU SECONDS: 11           CONNECT MINUTES: 56

   $STDIN LDEV: 24           $STDLIST LDEV: 24

   ...

   ...

As file names go, $STDIN and $STDLIST look odd because the file names begin with $.

Only the computer system can create or use file names that begin with $. These "dollar sign files" are system defined files that the computer uses for sending and receiving information.

  • $STDIN is the computer's standard input file.

    During a session, it is the keyboard that sits on your desk.

  • $STDLIST is the corresponding standard list file, and it is the computer's standard output file.

    During a session, it is the video screen on your desk.

When you enter information through your keyboard, it goes to the standard input file. $STDIN is a holding place for everything that you enter at the keyboard. As you type, $STDIN accumulates the characters that you type. When you press Return, the contents of $STDIN are sent to the operating system for analysis and action.

When the operating system sends information back to you during a session, it sends it to $STDLIST, your video screen.

The LDEV connection

You may have noticed that in the previous example of SHOWME that $STDIN and $STDOUT are both associated with something called LDEV: 24. LDEV 24 is the identity of a terminal.

It is likely that several people are using the computer at the same time. In order to distinguish among the constant flow of inputs and outputs, the computer has to know which terminal is sending information and which terminal should receive its corresponding output.

The computer solution is to assign each device a unique number. Your terminal device, for instance, might be identified as LDEV 24. LDEV stands for logical device (number). Device number 24 (a video screen and a keyboard) is "associated" with--"connected to" may be easier to envision--$STDIN and $STDLIST. And that is reflected in the display on the screen when you use SHOWME.

   ...

   $STDIN LDEV: 24           $STDLIST LDEV: 24

   ...

This connection tells the computer the source and destination of information coming from and going to your terminal, or from any terminal. And because each terminal has a unique device number, the computer never becomes confused.

TIP: A logical device is not a machine, nor is it a physical object. It is a connection to the computer that is made through an intermediating file or process. This "logical" connection is not the same as the cable used to carry information to and from a device. The cable is hardware, a physical object, a thing that you can touch.

The console

Whether your terminal is designated as 24, 25, or 37—or some other number—is determined when the computer is first set up. If terminals are added to the system, they will be numbered in sequence as they are added.

One terminal, however, is almost always LDEV 20: the console. The console is the terminal at which a system supervisor or system manager works to oversees the day-to-day operation of the computer. There is no special meaning to the number 20. It is simply a convention. If you wish to discover the LDEV number of the console, enter:

   CONSOLEReturn

You may, if you wish, think of the console as the master terminal for the computer. Certain commands and operations are permitted only at the console. Some of those commands and operations are mentioned in Chapter 7 “Commands”.

TIP: A terminal is a physical object, hardware. In that sense, it is more accurate to regard the console as a terminal at which certain, critical operations are permitted. The person who manages your system may use the CONSOLE command to transfer those special abilities to another terminal. Using the CONSOLE command in this fashion is sometimes called "moving the console," although there is no physical motion involved.

Other LDEVs

If you use your computer's printer, you are (probably) using LDEV 6. A tape drive is usually identified as LDEV 7.

Certain LDEV numbers are assigned for special purposes. LDEV 1, for instance, is always the master volume of the system disk. That never changes. With such exceptions in mind, it is possible, for someone authorized to use a special program, the SYSGEN utility, to assign almost any LDEV number to any device. Such assignments are made when your system is first set up.

TIP: Using SYSGEN requires special knowledge. Do not attempt to use it without proper training.

LDEV 6 is probably associated with your printer. LDEV 7 is usually associated with a tape drive--but there is nothing to prevent someone from connecting your printer to a different LDEV. It is certainly worth asking the person who manages your computer to tell you which LDEV numbers are assigned to which devices. Or you may use the SHOWDEV command to see a listing of device assignments.

The file equation connection

If your work involves using programs, you can usually rely on the program that you are using to direct information to a printer (or to another device) when you issue the proper instructions. These instructions usually take the form of commands that are "built into" the program itself.

The commands built into any program "talk" to the computer. In essence, a command might say to the computer: "I have something to print. Please send this to the correct place." The computer looks among its resources, finds a printer (if there is one), and directs the information to a printing process. Under these circumstances, the computer "chooses" the printer that will receive and print the information.

TIP: The computer does not make whimsical choices. Behind every action that the computer takes is a program or process that makes choices based upon the information that it receives from you and upon information that it has about its own resources.

However, there may be times when you may want to influence the choices that the computer makes.

The PRINT command normally instructs the computer to display the contents of a file on a video screen. That is how the programming engineers designed it.

You might, however, want to use the PRINT command to send the contents of a file to a printer. You can do that.

TIP: From the computer's point of view, "printing" something on paper, and "printing" something on the screen are virtually identical tasks, because it regards printers and video terminals as files.

This makes things simpler for the computer, but sometimes makes them a little puzzling to people.

When you use the PRINT command the computer's "thinking" goes something like this:

   "I AM GOING TO TAKE THE CONTENTS FROM ONE FILE"

   "I AM GOING TO SEND THE CONTENTS TO ANOTHER FILE"

From which file? To which file?

The computer does not care. Instead, it takes its instructions regarding to "from" and "to" directly from the PRINT command.

   PRINT TAXJAN

That seems understandable: print the contents of the file TAXJAN.

The computer understands that, too, and it displays the contents of the file TAXJAN on your video screen. Why?

PRINT TAXJAN specifies a file for the computer to find. It does not explicitly specify any destination to which it should send the contents of that file.

Still, the computer knows what to do. During a session, the PRINT command is programmed to send information from a disk file to the system-defined file called $STDLIST, which happens to be your video screen. Because no destination was explicitly specified with the PRINT command, the computer uses the default destination that it was programmed to use when you do not explicitly specify a destination ($STDLIST).This touches on the subject of default parameters, which is covered in “Defaulted or Omitted Parameters”.

If instead you wanted to use PRINT to send the contents of a file to a printer, you would need to instruct the computer to send it to a file associated with or equated to a printer.

In essence, you tell the computer: "I want you to behave as though the printer is the real destination for my file" This redirection of information involves using the FILE command this way:

   FILE XYZ;DEV=LPReturn

Using the FILE command in this way creates a file equation. LP is a device class name for a printer. This use of the FILE command tells the computer: "during this session, please regard the file XYZ as a printer."

TIP: The device class name for a Mercedes Benz is "automobile" (or "car"). A device class name identifies things that are sufficiently alike in their appearance or operation that a single word adequately describes them. There may be differences between them, as there are differences between automobiles, but the differences do not alter the fundamental "sameness" of their design, use, or purpose.

Where is the file XYZ, and what is in it? In purely physical terms, it does not exist, nor is there anything in it. You might think of it as an alias, an invented name that refers to a real person but not by that person's real name.

To print a file called TAXJAN on the printer known by the device class name LP, you would next use the PRINT command this way:

   PRINT TAXJAN,*XYZReturn

This "sentence" of computer instruction tells the computer to send the file TAXJAN to a file (an alias) called XYZ.

The asterisk (*) preceding the XYZ creates a backreference. The computer then looks back to find the file equation in which XYZ is defined (FILE XYZ;DEV=LPReturn).

When the computer traces this reference to XYZ, it finds that XYZ is to be regarded as a printer. The file called TAXJAN goes to the printer, just as youwanted it to do.

Worth Remembering:

LP is a common device class name for a printer on an MPE/iX system; however, the people who set up your computer could--and might--assign a different device class name for your printer(s).

It is possible--and very likely--that someone has already created a file equation to direct information to your printer and has made it a permanent feature of your system. To see a listing of the file equations that are current during your session, enter this command:

   LISTEQReturn

Whatever device class name is assigned, many of the programs that you use, including HP Easytime/iX, will already "know" how to find the printer and how to send information there. Whatever device class name is assigned, it may be worthwhile to ask for that information from the person in charge of your system.

Input default for PRINT

During a session you might, in a moment of haste, enter this:

   PRINTReturn

Now the computer will obediently take information from the system-defined file $STDIN, which happens to be your keyboard. And it sends whatever you type to the system-defined file $STDLIST, which happens to be your video screen. The results can be puzzling.

Nothing happens until you type a line at the keyboard. Then, when you press Return, the computer sends that line to your video screen. What you will see is something like this:

   MARY HAD A LITTLE LAMB, ITS FLEECE WASReturn

   MARY HAD A LITTLE LAMB, ITS FLEECE WAS

   _

The problem now is that the computer will go on doing this until you tell it to stop by using the :EOD (end of data) command this way:

   MARY HAD A LITTLE LAMB, ITS FLEECE WASReturn

   MARY HAD A LITTLE LAMB, ITS FLEECE WAS

   :EODReturn

   _

You must enter EOD on a blank line, and you must put the colon (:) before it.

TIP: PRINT ,NEWFILE (notice the comma) takes whatever you type at the keyboard, line by line, and puts it into a file called NEWFILE, until you enter the :EODcommand. NEWFILE is a temporary file, meaning that it will disappear when you log off. To turn it into a permanent file, enter this:
   SAVE NEWFILEReturn

Redirecting STORE

Redirection (through a file equation) is involved in using the STORE command to copy files from the disk to your DDS tape:

   FILE T;DEV=TAPE

   STORE @.@.FINANCE;*T

Here, TAPE is a device class name for a tape drive. All of the files in all of the groups in the FINANCE account will be copied to tape.

A file equation of this sort may have been established on your system. T is a common reference in MPE/iX for a tape drive. Still, it might be something different on your system. That, too, is worth knowing.

Configuration--teaching the computer

The number of devices connected to your system is potentially large. With some exceptions, your computer leaves the factory having no knowledge of which devices you might attach or how many of them.

Telling the computer which devices are attached (and how to find them) is a process called configuration. The configuration--a description of the number, type, and location of its parts--might differ from one MPE/iX computer to another. You might attach devices that someone with another MPE/iX computer does not use at all. One computer system might have six terminals; another might have 23.

When your computer is first set up, SYSGEN is one of the very first commands that the manager of your system uses. The SYSGEN command calls up the SYSGEN utility, a highly specialized program that starts the configuration "dialog."

With your Series 9X8LX computer, you may, if you wish, have SYSGEN draw upon default settings to define the devices attached to the system.

At the end of the configuration dialog, that configuration information is stored in a configuration file, which is one of the system files that the computer maintains for its own use.

TIP: Using SYSGEN requires special knowledge. Do not attempt to use it without proper training.

System files should be backed up to a special system recovery tape (SRT) when the system is first set up. And it is wise to back up these system files whenever they change. They can change.

Each time you add one or more new devices to your system, you must use SYSGEN to add this information to the existing configuration. This is the time to back up the system files and create a new SRT. In the event of a serious problem with the computer, you might have to reconfigure the entire system. Having a current set of backup system files makes the job much easier.

Spool files/print files

One more significant group of files deserves your attention. These files exist because no computer system can do all things simultaneously.

Spool files are different from the kinds of files that you will work with directly.In fact, most of the time you will have little contact with spool files, except under special circumstances.

Spool files exist to hold information that is on its way to somewhere else, such as printer. On the instructions of a program or a command that you might use, the computer creates spool files. They are the computer's equivalent of in-baskets and out-baskets. The computer fills them, waits for an instruction to use the contents, sends the contents on for processing or printing, and then (usually) erases them.

For that reason, the story of spool files belongs in Chapter 5 “Where Does the Information Go?”, under “Spool Files/Print files”.

Feedback to webmaster