HPlogo Accessing Files Programmer's Guide: HP 3000 MPE/iX Computer Systems > Chapter 1 Introduction

Disk Files and Device Files

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

The file system recognizes two basic types of files, classified on the basis of the media on which they reside when processed:

  1. Disk files, which are files residing on disk, are immediately accessible by the system and potentially shareable by several jobs/sessions at the same time.

  2. Device files are files currently being input to or output from any peripheral device except a disk. When information exists on such a device but is not being processed, the file system cannot recognize it as a file. Thus, information on a magnetic tape is not identified as a file until the tape is loaded onto a tape drive and reading begins; data being written to a line printer is no longer regarded as a file when output to the printer terminates. A device file is considered nonshareable; it is accessed exclusively by the job or session that acquires it, and is owned by that job/session until the job/session explicitly releases it or terminates.

NOTE: Spooled device files, although temporarily residing on disk, are considered device files in the fullest sense because they are always originated on or destined for devices other than disk, and because you generally remain unaware of their storage on disk as an intermediate step in the spooling process. Whether they deal with spooled or unspooled device files, your programs handle input/output as if the files reside on nonshareable devices. The console operator, not the user, controls the spooling operation.

Topics in this Manual

When you create a file, you specify certain permanent attributes that the file will have based upon its intended use. Chapter 2, "Creating a File" describes the physical characteristics that are determined when you create a file and the intrinsics and commands you use to specify those physical characteristics

What name do you give a file that you create? How does MPE/iX recognize your file? Chapter 3, "Specifying a File Designator" describes how you designate a file name in your program and discusses file naming conventions maintained by MPE/iX.

You may classify your file as a new, temporary, or permanent file. Chapter 4, "Specifying a Domain" discusses these classifications.

Before your program can access or otherwise manipulate a file, the program must open that file. Program examples illustrating various ways you can open a file are described in Chapter 5, "Opening a File."

Once your program is finished accessing or manipulating a file,the file must be closed. Program examples illustrating various ways you can close a file are described in Chapter 6, "Closing a File."

One of the file system's principal concerns is the transfer of information to and from your files. Chapter 7, "Record Selection and Data Transfer" discusses how you can use MPE/iX file system intrinsics to select records and transfer data between your program and files.

Program examples illustrating various ways to write data from your program to a file are described in chapter 8, "Writing to a File."

Program examples illustrating various ways to read data from a file are described in chapter 9, "Reading From a File."

A special method of accessing a file, called update access, is discussed in chapter 10, "Updating a File."

You can access a file mapped directly through memory loads and stores, thus bypassing the overhead associated with accessing the file through file system intrinsics. Chapter 11, "Accessing a File Using Mapped Access" describes mapped access of a file and the applications where mapped access may increase your program's performance.

There are special considerations you must take into account when you are accessing a file that is being shared concurrently by others. Chapter 12 ,"Sharing a File" discusses file sharing methods available to you.

Associated with each account, group, and individual file, is a set of security provisions that specifies any restrictions on files in that account or group, or to that particular file. These provisions are discussed in chapter 13, "Maintaining File Security."

MPE/iX provides a number of commands and intrinsics that enable you to obtain information about your files. You can use the commands and intrinsics described in chapter 14, "Getting File Information" for a variety of purposes.

The HP Pascal/iX program examples found in appendix A, "HP Pascal/XL Program Examples" are provided to help you better understand how to use file system intrinsics to perform file access tasks.

Feedback to webmaster