Accessing Files Programmer’s Guide 900 Series HP 3000 Computer Systems Manufacturing Part Number: 32650-90885 E0300 U.S.A.
Notice The information contained in this document is subject to change without notice. Hewlett-Packard makes no warranty of any kind with regard to this material, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. Hewlett-Packard shall not be liable for errors contained herein or for direct, indirect, special, incidental or consequential damages in connection with the furnishing or use of this material.
Contents 1. Introduction Disk Files and Device Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Topics in this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2. Creating A File The HPFOPEN Intrinsic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . NOWAIT I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents Temporary Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87 Permanent Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .88 Changing Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 Searching File Directories. . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents 8. Writing to a File Sequential Access and Random Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Writing to a disk file using sequential access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Writing to a disk file using random access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Writing to $STDLIST. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents Semi-exclusive access. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155 Shared access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155 Multiaccess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156 Global multiaccess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents Program Example A-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Program Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Source code listing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Program Example A-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents 8
Figures Figure 1-1.. File System Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Figure 1-2.. Records/Files Relationship . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Figure 2-1.. File System Hierarchy of Overrides . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Figure 2-2.. Fixed-Length Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Figure 2-3..
Figures 10
Tables Table 2-1.. FOPEN/HPFOPEN Parameter Equivalents . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Table 2-2.. Determining a File's Physical Characteristics Using FOPEN . . . . . . . . . . . . . 49 Table 2-3.. FILE, FOPEN, and HPFOPEN Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Table 2-4.. Comparison of Logical Record Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Table 2-5.. Standard Default Record Sizes. . . . . . . . . . . . . . . . . . . .
Tables 12
1 Introduction Almost every kind of organization in our modern society is concerned in some way with information. Corporations keep track of their business dealings, political groups keep lists of potential voters, and families remember whose turn it is to do the dishes. When an organization needs to deal with large amounts of information in an efficient, dependable manner, a computer can be an indispensable aid.
Introduction processed, and output as a single unit. Logically related records are grouped into sets known to the file system as files, which may be kept in any storage medium or sent to any input/output peripheral (as illustrated in Figure 1-2. below). Figure 1-2. Records/Files Relationship Since all input/output operations are done through the mechanism of files, you may access very different devices in a standard, consistent way.
Introduction Disk Files and Device Files Disk Files and Device Files 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.
Introduction Disk Files and Device 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.
2 Creating A File When you create a file, you choose the attributes that file will have; your choices are made on the basis of how the file will be used. A file's physical characteristics are determined by the parameters you choose when you create the file with the HPFOPEN/FOPEN intrinsic or the BUILD command, or when you specify the file with the FILE command. Once a file has been created, its physical characteristics cannot be changed.
Creating A File The HPFOPEN Intrinsic The HPFOPEN Intrinsic The HPFOPEN intrinsic establishes access to a disk or device file and enables you to create a file on a shareable device. HPFOPEN is used to define a file's physical characteristics, including file and record structure. Its syntax is HPFOPEN (filenum, status, [, itemnum, item]...); The HPFOPEN optional parameters are a superset of the options provided in the FOPEN intrinsic and provide more efficient access to files.
Creating A File The HPFOPEN Intrinsic Aborting NOWAIT I/O Occasionally, after a process has started a NOWAIT I/O with FREAD or FWRITE, something occurs that causes completion of that I/O to be no longer needed. Perhaps the process is "shutting down" and does not want to wait for the I/O (that is, to issue IOWAIT or IODONTWAIT). MPE/iX lets the process abort NOWAIT I/Os that have not yet completed by using FCONTROL with a control code of 43.
Creating A File The HPFOPEN Intrinsic the file name must start with either a dot (.) or a slash (/). The file referred to by formaldesig may reside either in an MPE group or in an HFS directory. For files located in HFS directories, traverse directory entries (TD) access is required to all directories specified in formaldesig. If there is no TD access, HPFOPEN fails and a value of -180 is returned in the status.info parameter.
Creating A File The HPFOPEN Intrinsic A device file (such as a tape drive, terminal, spooled printer or hot printer) always resides in the system file domain (permanent file directory). Always specify a device file as old or permanent. The following values are valid: 0 The file is a new temporary file. It is not placed in a directory. 1 The file is a permanent file, found in the system file domain. 2 The file is a temporary file, found in the job file domain.
Creating A File The HPFOPEN Intrinsic itemnum=9 option. 6/I32 Record format: Passes a value indicating the internal record structure desired for the file. This option is applicable only at file creation. The following values are valid for records: 0 Fixed-length 1 Variable-length 2 Undefined-length (no implied structure) 9 Byte stream 10 Hierarchical directory Default: 0 Byte stream record format may be specified only for standard disk files (itemnum 10 equal to 0).
Creating A File The HPFOPEN Intrinsic control parameter in the call to FWRITE, or by sending the control code directly through the control parameter of FWRITE. If a carriage-control character is sent to a file where the control cannot be executed directly (for example, line spacing characters sent to a disk or tape file), the control character is embedded as the first byte of the record.
Creating A File The HPFOPEN Intrinsic Passes a value indicating whether or not file equations are allowed. A leading * in a formal file designator overrides the setting to disallow file equations. The following values are valid: 0 Allow file equations to override programmatic or system-defined file specifications. 1 Disallow file equations from overriding programmatic or system-defined file specifications.
Creating A File The HPFOPEN Intrinsic Chapter 2 0 Read access only, if the file's security provisions allow read access. FWRITE, FUPDATE, and FWRITEDIR intrinsic calls cannot reference this file. The end-of-file (EOF) is not changed; the record pointer starts at zero. (Default) 1 Write access only, if the file's security provisions allow write access. Any data written in the file prior to the current HPFOPEN request is deleted.
Creating A File The HPFOPEN Intrinsic loaded file. The program must be running in PM to specify execute-read access. This is changed to execute access for KSAM, CIR, and RIO files. Not valid for message files. 8 Reserved for MPE/iX. No access, opens the file or directory without any access checking. A process must be executing in system code to use this access type. 9 Directory read access, opens a directory for directory read access.
Creating A File The HPFOPEN Intrinsic 13/I32 Exclusive: Passes a value indicating continuous exclusive access to the file, from open to close. Use this option when performing a critical operation (for example, updating the file). The following values are valid: 0 If itemnum=11 specifies read only access, read-share access takes effect. Otherwise, exclusive access takes effect. Regardless of which access option was selected, FFILEINFO reports zero.
Creating A File The HPFOPEN Intrinsic concurrent access to this file by any process, in any access mode, subject to other basic security provisions in effect. For message files, specifying this value means that there can be multiple writers and one reader. Default: 0 (ASC) This option is ignored for devices. FIFO files should be opened for Share Access (3). Other exclusive accesses to file will cause unexpected results to occur.
Creating A File The HPFOPEN Intrinsic length parameter of the read or write request) exceeds the size of the physical record (that is, a block) that is referenced, the remaining half words or bytes are taken from subsequent successive records until the number specified by length has been transferred. For message (MSG) files not accessed with itemnum=17 enabled, the file system sets this option to zero. This option is available only if itemnum=46 is set to 1. (ASC) This option is not used for printers.
Creating A File The HPFOPEN Intrinsic 18/I32 Short-mapped: Returns a short pointer to the beginning of the data area of the file. This option maps the file into short pointer space. A short-mapped file can be 4 megabytes in length. The calling process can have up to 6 megabytes of short-mapped files open at a time. Use the pointer as a large array of any type to efficiently access the file. NOTE SHORT MAPPED files are limited to 4 MB in size per file with a 6MB/process limit.
Creating A File The HPFOPEN Intrinsic For example, if a record size of 105 is specified for a fixed-length binary file, HPFOPEN sets the record size to 106; if a record size of 233 is specified for a fixed-length ASCII file, the record size remains the same as it was when specified. The value specified for this itemnum is ignored when a byte stream file or hierarchical directory is created. Byte stream files are created with a logical record size of one byte (1).
Creating A File The HPFOPEN Intrinsic sharing mechanisms. All file system intrinsics applicable to the file can be used. FREAD and FWRITE calls can be mixed with this option. Standard (STD) disk files of fixed or undefined record length can be accessed with this option. Standard disk files of variable record length can be accessed only if itemnum=11 (read-only access).
Creating A File The HPFOPEN Intrinsic this option: itemnum=20 itemnum=22 itemnum=23 itemnum=42 Default: A disk file located on the volume class DISC associated with the group in which the file resides. This itemnum may not be specified when creating hierarchical directories. (ASC) Not used for asynchronous devices. 24/I32 Density: Passes the tape density required when writing to a tape file. This option is applicable only when writing to a tape on a drive that supports more than one density.
Creating A File The HPFOPEN Intrinsic Default: No node name passed (local file access) A character placed in the first element designates the delimiter used by HPFOPEN to search for the end of the character array.
Creating A File The HPFOPEN Intrinsic 0 Privilege level zero (most privileged level) 1 Privilege level one 2 Privilege level two 3 Privilege level three (least privileged level) Default: The execution level of the calling process 30/I32 Labeled tape type: Passes a value that indicates tape label type information. This option is valid only for labeled tapes. The following values are valid: 0 ANSI standard labels 1 IBM standard labels Default: 0 (ASC) Not used for asynchronous devices.
Creating A File The HPFOPEN Intrinsic Default: No array passed (no sequence indicated) A character placed in the first element designates the delimiter used by HPFOPEN to search for the end of the character array. The delimiter can appear again only following the last valid character of the character array, for example, %position% (% is the delimiter, position is the designator) fabcxyzf (f is the delimiter, abcxyz is the designator) (ASC) Not used for asynchronous devices.
Creating A File The HPFOPEN Intrinsic dependent upon both the record size and the number of extents defined for the file: — For circular and RIO files, recsize=256 bytes and numextent=32. This option is applicable only at file creation. Default: 2 gigabytes This itemnum may not be specified when creating hierarchical directories. (ASC) Not used for asynchronous devices. 36/I32 Initial allocation: Passes a positive integer value indicating the number of records to be allocated to the file initially.
Creating A File The HPFOPEN Intrinsic 0 Privilege level zero (most privileged level) 1 Privilege level one 2 Privilege level two 3 Privilege level three (least privileged level) Default: 3 39/I32 Access type: Passes a value indicating how to use the file, either sequentially or randomly. The file system uses this information to determine the most efficient prefetching algorithm to improve the performance of the file access.
Creating A File The HPFOPEN Intrinsic itemnum 52 or system-defined file references specified through itemnum 5. 42/CA Device class: Passes a device class where the file resides. The file system uses the device class name to select a nonshareable device from a configured list of available devices. The name can have a length of up to eight alphanumeric characters, beginning with a letter (for example, TAPE). If a device class is specified, the file is allocated to any available device in that class.
Creating A File The HPFOPEN Intrinsic 44/I32 Numbuffers: Passes the number of buffers to allocate to the file. Ignored for standard disk files. This option is useful only for slow devices (such as tapes) used in a buffered mode. Not applicable for files representing interactive terminals; a system-managed buffering method is always used. The valid range for this option is dependent upon the file type: • For standard and KSAM files, the valid range is 1..31.
Creating A File The HPFOPEN Intrinsic With NOBUF access, responsibility for blocking and deblocking of records in the file belongs to the program. To be consistent with files built using buffered I/O, records should begin on half word boundaries. When the information content of the record is less than the defined record length, you must pad the record with blanks if the file is ASCII, or with zeros if the file is binary.
Creating A File The HPFOPEN Intrinsic 48/I32 Reverse VT: Passes a value indicating whether or not the given device name is to be allocated on a remote machine. Specify the remote environment in the same open request, using either the formal designator option or the remote environment option. Reverse VT behaves nearly the same as a terminal opened through remote file access, except that no session is required on the remote machine.
Creating A File The HPFOPEN Intrinsic effect as specifying final disposition option itemnum=2, except that tape files are not rewound. In the case of unlabeled magnetic tape, if the FCLOSE is the last done on the device (with no other FOPEN/HPFOPEN calls outstanding), the tape is rewound and unloaded. If the file resides on a labeled magnetic tape, the tape is positioned to the beginning of the next file on the tape. 4 Released file. The file is deleted from the system.
Creating A File The HPFOPEN Intrinsic Reference Manual.) This option allows the specification of options available in the FILE command. The formaldesig parameter and filereference parameter can contain embedded command interpreter variables and expressions. However, there cannot be more than 8-characters in each of these components (filename, lockword, groupname, accountname) including the command interpreter variable and expression characters.
Creating A File The HPFOPEN Intrinsic (ASC) Not used for asynchronous devices. 55 Reserved for the operating system 56/I32 Object class: Passes a user object class number, in the range 0..10, that is associated with the file. Default: Determined by the file code for system and subsystem files, and by the file type and record type for normal user files.
Creating A File The HPFOPEN Intrinsic executing in system code. 2 When this value is specified, the system attempts to let the caller access the file as a native byte stream file. Byte stream emulation is supported for ordinary fixed and variable length record files as well as for files with the byte stream record type. If this value is requested against a file type that does not support byte stream access, an error is returned.
Creating A File The HPFOPEN Intrinsic Optional parameters you can use to specify file access and device control characteristics are described elsewhere in this manual. For more details on the HPFOPEN intrinsic, refer to the MPE/iX Intrinsics Reference Manual.
Creating A File The FOPEN Intrinsic The FOPEN Intrinsic The FOPEN intrinsic is the other programmatic interface for supplying the file system with information about your file.
Creating A File The FOPEN Intrinsic Table 2-1.
Creating A File The BUILD Command Table 2-2.
Creating A File The FILE Command The FILE Command The FILE command is used to determine how a file will be accessed. You may use FILE to describe any of the characteristics available with HPFOPEN/FOPEN or BUILD, but you cannot actually create a file with the FILE command. While HPFOPEN/FOPEN and BUILD physically allocates space for a file and define its characteristics, the FILE command may only define how a file will be accessed at run time.
Creating A File The FILE Command Table 2-3.
Creating A File The FILE Command Table 2-3.
Creating A File The FILE Command Table 2-3.
Creating A File Summary of Overrides Summary of Overrides If a FILE command has been entered that contradicts some of the HPFOPEN/FOPEN parameters for a file, which takes precedence? What happens if some parameters are left out? The file system maintains a hierarchy of overrides for just such situations (illustrated in Figure 2-1.): Figure 2-1.
Creating A File Specifying a Record Format Specifying a Record Format A file can contain records written in only one of three formats: fixed-length, variable-length, and undefined-length. You can specify the format that you want for your records, either with the HPFOPEN/FOPEN intrinsic or the MPE/iX BUILD or FILE commands. Files residing on disk or magnetic tape may contain records in any of the three formats.
Creating A File Specifying a Record Format record is accompanied by an indication of its length. When you build a file containing variable-length records, specify a record size at least large enough to accommodate your longest record. Figure 2-3. depicts a file with variable-length records. The byte count preceding the first byte of each record gives its record's length. Figure 2-3.
Creating A File Specifying a Record Format data and the filler. Figure 2-4. depicts a file with undefined-length records. When data does not fill the space allocated, filler occupies the unused space. Figure 2-4. Undefined-Length Records The three record formats, fixed-length, variable-length, and undefined-length are summarized in Table 2-4. on page 58 Table 2-4. Comparison of Logical Record Formats Fixed-Length Variable-Length Undefined-Length Data length known to file system.
Creating A File Specifying a File Type Specifying a File Type When you create, a file the file system imposes a structure and access method on the contents of the file. The file system allows you to access the records in a file only in the manner dictated by the file type that you specified at file creation. Depending upon your intended use of the file, you can specify four special file types in addition to the standard file type: KSAM files, RIO files, circular files, and message files.
Creating A File Specifying a File Type files may not be simultaneously accessed by both readers and writers. When the file has been closed by all writers, it may be read; a reader takes records from the circular file one at a time, starting at the head of the file. Circular files are particularly useful as history files, when a user is interested in the information recently written to the file and is less concerned about earlier material that has been deleted.
Creating A File Specifying Record Size Specifying Record Size You can specify the size of the records in your file by using the BUILD (for disk files) or FILE commands, or the HPFOPEN/FOPEN intrinsic; however, the interpretation of the requested record size can be affected by the record structure and data format chosen as well as the device for the file.
Creating A File Specifying Record Size Figure 2-5. Record Placement for ASCII Files Rather than specify your own record size, you can accept the default record size for the device that you are using. Default record sizes are listed in Table 2-5. on page 62 Note that subsystem defaults may be different from MPE defaults; for example, the Editor default may be 72 or 80 bytes (depending on text format) while the MPE standard default is the record size configured for the device. Table 2-5.
Creating A File Specifying Disk Volume Restrictions Specifying Disk Volume Restrictions MPE/iX makes a distinction between the device and the media. The device is the disk drive and the media is the disk pack. The MPE/iX volume management facility controls the media and divides the media into three entities: • Volume set, a set of related disk packs assigned to the group in which you create your file. • Volume class, a subset of a volume set. A volume can be assigned to more than one volume class.
Creating A File Specifying a File Code Specifying a File Code MPE/iX subsystems often create special-purpose files whose functions are identified by four-digit integers called file codes, written in their system file labels. HPFOPEN/FOPEN, BUILD, and FILE have parameters that enable you to specify a file code for your file when you first create it. For user files, you can use as a file code any number from 0 through 1023. Numbers above 1023 listed in Table 2-6.
Creating A File Specifying a File Code Table 2-6.
Creating A File Specifying a File Code Table 2-6.
Creating A File Specifying a File Code Table 2-6.
Creating A File Specifying a File Code Table 2-6.
Creating A File Specifying a File Code Table 2-6.
Creating A File Specifying Storage Format Specifying Storage Format Devices on the HP 3000 can transmit information in ASCII (American Standard Code for Information Interchange) and/or binary code, depending on the device. For example, a line printer handles ASCII formatted data, while a disk can transmit and store data in either format.
3 Specifying a File Designation The name by which a program recognizes your file is its formal file designator. This is the file name that is coded into the program, along with the program's specifications for the file. The formal file designator is the name by which your program recognizes the file, but there must also be a means by which the file system can recognize it, allowing it to be referenced by various commands and programs.
Specifying a File Designation MPE/iX File Designators MPE/iX File Designators The file system recognizes two general classes of files: • user-defined files, which you or other users define, create, and make available for your own purposes • system-defined files, which the file system defines and makes available to all users to indicate standard input/output devices These files are distinguished by the file names and other descriptors (such as group or account names) that reference them, as discussed below.
Specifying a File Designation User-Defined Files User-Defined Files You can reference any user-defined file by writing its name and descriptors in the filereference format, as follows: filename[/lockword][.groupname][.accountname] In no case must any file designator written in the filereference format exceed 35 characters, including delimiters.
Specifying a File Designation User-Defined Files As another example, suppose that you are logged on under the group name XGROUP but wish to reference a file named X3 that is assigned to the Public Group of your account. If your program refers to this file by the name FILLER, you would enter: FILE FILLER=X3.PUB When you reference a file that does not belong to your logon account, you must use an even more extensive form of the filereference format.
Specifying a File Designation User-Defined Files In addition, the slash mark (/) that separates these names should not be preceded or followed by blanks. The lockword may contain from one to eight alphanumeric characters, beginning with a letter. If a file is protected by a lockword and you fail to supply that lockword in your reference, you are denied access to the file.
Specifying a File Designation User-Defined Files sometimes known as user predefined files. Whenever you reference a predefined file in a file system command, you must enter the asterisk before the formal designator if you want the predefinition to apply.
Specifying a File Designation System-Defined Files System-Defined Files System-defined file designators indicate those files that the file system uniquely identifies as standard input/output devices for jobs and sessions. These designators are described in Table 3-1. on page 77 When you reference them, you use only the file name; group or account names and lockwords do not apply. Table 3-1.
Specifying a File Designation System-Defined Files You could enter the following commands: FILE INFILE=$STDIN FILE OUTFILE=$STDLIST RUN MYPROG Input/Output sets All file designators can be classified as those used for input files (Input Set), or those used for output files (Output Set). For your convenience, these sets are summarized in Table 3-2. on page 78 and Table 3-3. on page 78 Table 3-2. Input Set File Designator Function/Meaning $STDIN Job/session input device.
Specifying a File Designation System-Defined Files former is duplicated automatically on the latter. For example, input from a magnetic tape device is printed on a line printer. You can determine whether a pair of files is interactive or duplicative with the FRELATE intrinsic call. (The interactive/duplicative attributes of a file pair do not change between the that time the files are opened and the time they are closed.) The FRELATE intrinsic applies to files on all devices.
Specifying a File Designation System-Defined Files Figure 3-1. Passing Files between Program Runs . . . FILE SOURCE1=DSFIL FILE INTERFIL=$NEWPASS RUN PROG1 FILE SOURCE2=$OLDPASS RUN PROG2 . . . <--|<--- Same File A program file must pass through several steps as it is executed; passed files are most frequently used between these steps. A program file must be compiled and linked before it is executed. By default, the compiled form of a text file is written to $NEWPASS.
Specifying a File Designation System-Defined Files Figure 3-2. Passing Files within a Program Run $NEWPASS and $OLDPASS are specialized disk files with many similarities to other disk files. Comparisons of $NEWPASS to new files, and $OLDPASS to old files, are given in Table 3-4. on page 81 and Table 3-5. on page 82. Table 3-4. New Files Versus $NEWPASS NEW $NEWPASS Disk space allocated. Disk space allocated. Disk address put into control block. Disk address put into control block.
Specifying a File Designation System-Defined Files Table 3-4. New Files Versus $NEWPASS NEW $NEWPASS Disk address not saved (Not in any directory). Disk address saved for future use in the current job session. Table 3-5. Old Files Versus $OLDPASS OLD $OLDPASS Directory (job temporary or system) searched for disk address Disk address obtained from Job Information Table (JIT) Disk address put into control block. Disk address put into control block. Default close disposition: Delete control block.
Specifying a File Designation Using Command Interpreter Variables and Expressions Within File Designators Using Command Interpreter Variables and Expressions Within File Designators Your file reference may also contain command interpreter variables and expressions that are evaluated before the file reference is parsed and validated.
Specifying a File Designation Parsing and Validating File Designators Parsing and Validating File Designators The FPARSE intrinsic parses and validates a file designator string to determine if it is syntactically correct. You can employ this intrinsic to check a formal file designator representing a file before attempting to open the file with HPFOPEN/FOPEN. MPE/iX file designators used for the file system and two user interface commands include a remote environment ID (envid).
Specifying a File Designation Parsing and Validating File Designators Figure 3-4. Illustration of FPARSE Usage In Figure 3-5., below, the file string is "$OLDPASS": Figure 3-5. Illustration of FPARSE Usage Note that "$" is a special exception to the rules of file names and is considered part of the file name, unlike "*", which is not.
Specifying a File Designation Parsing and Validating File Designators 86 Chapter 3
4 Specifying a File Domain One way to classify a file is on the basis of its domain. A file can be permanent or temporary, or it may exist only to one particular process. The file system maintains separate directories to record the location of temporary files and permanent files. Of course, there is no file system directory for files that exist only to their creating process (new files).
Specifying a File Domain Permanent Files Permanent Files A permanent file exists as a file in the system file domain. Its existence is not limited to the duration of its creating job or session, and depending on security restrictions, it may be accessed by jobs or sessions other than the one that created it. Some or all of the space for a permanent file has already been allocated, and its physical characteristics have been defined. Table 4-1.
Specifying a File Domain Changing Domains domain option set to NEW (to maintain compatibility with with MPE V/E), but a warning is returned in the status parameter. Changing Domains A file need not always stay in the same domain. Any disk file can be made permanent, or can be deleted when it has served its purpose. The disposition parameter of the FCLOSE intrinsic can specify a different domain for a file as it closes, or the FILE command can be used to change the domain of a file.
Specifying a File Domain Searching File Directories Searching File Directories There are two directories with addresses of files: the temporary file directory (job file domain) for the addresses of temporary files and the permanent file directory (system file domain) for the addresses of permanent files. There is no directory for new files.
5 Opening a File Before your program can read, write, or otherwise manipulate a file, the program must initiate access to that file by opening it with the HPFOPEN/FOPEN intrinsic call. This call applies to both disk files and device files. This chapter discusses how you can use HPFOPEN to open various types of files supported by MPE/iX. Examples of program segments are provided to illustrate HPFOPEN calls.
Opening a File How the File System Opens a File • Determining that the file has not been allocated exclusively to another process (by the exclusive option in an HPFOPEN/FOPEN call issued by that process). • Processing user labels (for files on disk). For new files on disk, HPFOPEN/FOPEN specifies the number of user labels to be written. • Constructing the control blocks required by MPE/iX for this particular access of the file.
Opening a File Which to Use: HPFOPEN or FOPEN When the HPFOPEN/FOPEN intrinsic is executed, it returns to your program a file number. If the file is opened successfully, the file number returned is a positive integer. At this point, the file is ready to be accessed with system intrinsics (for example, FREAD or FWRITE). If the file cannot be opened, the file number returned is zero, and the intrinsic returns an error condition.
Opening a File Opening a Disk File following examples show how you can use the HPFOPEN intrinsic to open a disk file: • "Opening a new disk file" shows an example of an HPFOPEN call that creates a new disk file (see example 5-1). • "Opening a permanent disk file" shows an example of an HPFOPEN call that opens a permanent disk file that is to be shared among multiple concurrent accessors (see example 5-2).
Opening a File Opening a Disk File {ASCII/binary option ASCII_binary_option, ascii ); } if status <> 0 then handle_file_error (file_num, status); end; If the HPFOPEN call is successful, a positive integer value is returned in file_num, and status returns a value of zero. The new disk file is now open and can be accessed with system intrinsics. If an error or warning condition is encountered by HPFOPEN, status returns a nonzero value, thus invoking the error-handling procedure handle_file_error.
Opening a File Opening a Disk File update lockable shared ascii :=5; :=1; :=3; :=1; {enable update access to file {enable dynamic locking option {allow concurrent access by all {label will indicate ASCII code HPFOPEN (file_num, status, formal_designator_option,file_name, domain_option, permanent, access_type_option, update, dynamic_locking_option, lockable, exclusive_option, shared, ASCII_binary_option, ascii ); } } } } {formaldesignator option} {domain option} {access type option} {dynamic locking opt
Opening a File Opening a System-Defined File Opening a System-Defined File System-defined file designators indicate those files that the file system uniquely identifies as standard input/output devices for jobs and sessions. System-defined files are $STDIN, $STDINX, $STDLIST, $NEWPASS, $OLDPASS, and $NULL.
Opening a File Opening a System-Defined File If the HPFOPEN call is successful, a positive integer value is returned in inputfile_num, and status returns a value of zero. The file is now open and can be read from. If an error or warning condition is encountered by HPFOPEN, status returns a nonzero value, thus invoking the error-handling procedure handle_file_error. For more information about HPFOPEN parameters, refer to the MPE/iX Intrinsics Reference Manual.
Opening a File Opening a Device File Opening a Device File Device files are files that are currently being input to or output from a nonshareable device (any peripheral device except a disk). Because all file open operations are accomplished through the file system, you can open files on very different devices in a standard, consistent way, using the HPFOPEN or FOPEN intrinsics.
Opening a File Opening a Device File New and permanent device files When a process accesses a device file (a file that resides on a nonshareable device), the device's attributes may override information passed in the domain option of the HPFOPEN/FOPEN call. Devices used for input only are considered permanent files. Devices used for output only, such as line printers, are considered new files.
Opening a File Opening a Device File Example 5-5. Opening an Unlabeled Magnetic Tape File procedure open_unlabeled_magnetic_tape_file; const formal_designator_option domain_option access_type_option density_option device_class_option type pac80 = 2; = 3; =11; =24; =42; {defines {defines {defines {defines {defines HPFOPEN HPFOPEN HPFOPEN HPFOPEN HPFOPEN itemnum itemnum itemnum itemnum itemnum 2 3 11 24 42 } } } } } = packed array [1..
Opening a File Opening a Device File opens a labeled magnetic tape file labltape. Use of the HPFOPEN labeled tape label option indicates to the file system that the file is opened as a labeled magnetic tape file. Example 5-6.
6 Closing a File Once your program is finished accessing a file, the program can terminate access to the file with the FCLOSE intrinsic. This chapter discusses various ways that you can use the FCLOSE intrinsic to close disk files and device files. Examples are provided to illustrate important features available through the FCLOSE intrinsic.
Closing a File How the File System Closes a File You can specify the disposition of a file when it is opened when you use the final disposition option or the file equation option of the HPFOPEN intrinsic, or the FILE command. Both HPFOPEN options provides the same choices as the disposition parameter of FCLOSE, except that you can change the disposition of a file when the file is opened (as opposed to when the file is closed).
Closing a File Closing a Disk File Closing a Disk File The following examples show how you use the FCLOSE intrinsic to close a disk file: • "Closing a New Disk File as Permanent" shows an example of an FCLOSE call that closes the file opened in Example 5-1. • "Closing a Permanent Disk File" shows an example of an FCLOSE call that closes the file opened in Example 5-2.
Closing a File Closing a Disk File . . If the file could not be closed because an incorrect file_num was specified, or another file of the same name and disposition already exists, ccode returns a value of one, thus invoking the error-handling procedure handle_file_error. In Appendix A, "Pascal/XL Program Examples," Example A-1 uses a similar procedure to close a new disk file. For more information about FCLOSE parameters, refer to the MPE/iX Intrinsics Reference Manual.
Closing a File Closing a Magnetic Tape File Closing a Magnetic Tape File The operation of the FCLOSE intrinsic as used with unlabeled magnetic tape is outlined in the flowchart of Figure 6-1.. Figure 6-1.
Closing a File Closing a Magnetic Tape File Note that a tape closed with the temporary no-rewind disposition is rewound and unloaded if certain additional conditions are not met. It is possible for a single process to open a magnetic tape device using the device class option of HPFOPEN/FOPEN, then again open the already-allocated device by specifying its logical device number (ldev) using the device name option of HPFOPEN/FOPEN.
7 Record Selection and Data Transfer The chief activities of the file system involve the transfer of data. In this chapter we will examine how this is accomplished. As you read this chapter, keep these considerations in mind: • How are records selected for transfer? • What intrinsics are used for data transfer? • How is the record pointer affected by intrinsics? The last section of this chapter discusses the major points presented in this chapter as they pertain to magnetic tape files.
Record Selection and Data Transfer Record Selection Figure 7-1. Record Pointers Following initialization, the record pointer may remain in position at the head of your file, or it may be moved by the intrinsics used in record selection. Record Selection How are records selected for transfer? The file system intrinsics listed in Table 7-1.
Record Selection and Data Transfer Record Selection • RIO access, in which you access only records that are not deactivated. • Mapped access is a special type of access available only through the HPFOPEN intrinsic, in which you bypass file system data transfer mechanisms by referencing the file as an array using a pointer declared in your program. Mapped files are discussed in chapter 11, "Accessing a File Using Mapped Access".
Record Selection and Data Transfer Record Selection Table 7-1. Intrinsics for Data Transfer File must be opened with Read, Read/Write, or Update access. Successful read returns CCE condition code and transfer length; file error results in CCL condition code; end-of-file results in CCG condition code and returns a transfer length of zero. FWRITE Used for sequential write. May be used with fixed-length, variable-length, or undefined-length record files.
Record Selection and Data Transfer Multiple Record Transfers Table 7-1. Intrinsics for Data Transfer File must be opened with Update access. No multirecord update allowed. Successful update returns CCE condition code; file error results in CCL condition code; end-of-file results in CCG condition code. RIO access RIO is an access method that permits individual file records to be deactivated. These inactive records retain their relative position within the file.
Record Selection and Data Transfer Control Operations also set the the inhibit buffering option parameter to NOBUF in your HPFOPEN/FOPEN call or FILE command. When you read from a file in multirecord mode, you may not read beyond the EOF (end-of-file marker). When you write to a file in multirecord mode, you may write only up to the block containing the file limit.
Record Selection and Data Transfer Magnetic Tape Considerations record number relative to the start of the file (record 0). You can use The FPOINT intrinsic only with files that contain fixed-length or undefined-length records; variable-length record files are not allowed. The FPOINT intrinsic may not be used when you have opened your file with Append access; the file system returns a CCL condition if you attempt to use it in this case.
Record Selection and Data Transfer Magnetic Tape Considerations Figure 7-2. Magnetic Tape Markers As far as the magnetic tape hardware and software are concerned, the BOT marker is much more significant than the EOT marker because BOT signals the start of recorded information; but EOT simply indicates that the remaining tape supply is running low, and the program writing the tape should bring the operation to an orderly conclusion.
Record Selection and Data Transfer Magnetic Tape Considerations FCONTROL (FORWARD SPACE TO FILE MARK). A user program that spaces forward to logical tape marks (EOFs) with the FCONTROL intrinsic cannot detect passing the physical EOT marker. No special condition code is returned. FCONTROL (BACKWARD SPACE TO FILE MARK). The EOT reflective marker is not detected by FCONTROL during backspace file (EOF) operations.
Record Selection and Data Transfer Magnetic Tape Considerations 118 Chapter 7
8 Writing to a File This chapter describes, through program examples, various ways that you can use file system intrinsics to transfer data from your program to a disk file or a device file. This chapter is intended to illustrate topics introduced in chapter 7, "Record Selection and Data Transfer".
Writing to a File Sequential Access and Random Access operation. You use the FWRITEDIR intrinsic to write data randomly to a disk file. You must specify in FWRITEDIR which record that you want to write to. The file system sets the record pointer to the selected record, then transfers the data to the record from your program's stack. When you have accomplished the write operation, the file system automatically sets the record pointer to point to the beginning of the next record in the file.
Writing to a File Sequential Access and Random Access If an error is encountered by either FWRITE or FREAD, the condition code CCL is returned to the program, thus invoking the procedure handle_file_error. For more information about FWRITE parameters, refer to the MPE/iX Intrinsics Reference Manual. For more information about using the FREAD intrinsic, refer to chapter 9, "Reading from a File". For more information about opening a file, refer to chapter 5, "Opening a File".
Writing to a File Writing to $STDLIST end; {end procedure } The operation is performed in a loop. Before each write operation, record_num is decremented. The loop ends when the FREAD intrinsic encounters an EOF in old_disk_file (indicating the end of the file). For more information about FWRITEDIR intrinsic parameters, refer to the MPE/iX Intrinsics Reference Manual. For more information about the FREAD intrinsic, refer to chapter 9, "Reading from a File".
Writing to a File Writing Messages to the System Console . . message := 'WRITING A MESSAGE TO THE STANDARD LIST DEVICE.'; message_length := -46 {message is 46 bytes long } control_code := 0; PRINT ( message, {message written to $STDLIST } message_length, {number of bytes in message } controlcode {set to default } ); . . . For more information about PRINT parameters, refer to the MPE/iX Intrinsics Reference Manual.
Writing to a File Writing Messages to the System Console . . The PRINTOP intrinsic transmits a maximum of 56 ASCII characters to the system console. Longer messages are truncated to 56 characters. For more information about PRINTOP intrinsic parameters, refer to the MPE/iX Intrinsics Reference Manual.
Writing to a File Writing to a Magnetic Tape File Writing to a Magnetic Tape File The following discussion pertains to writing data to two different types of magnetic tape files. • unlabeled magnetic tape files • labeled magnetic tape files Unless you specifically create and open a labeled magnetic tape file, the file system opens an unlabeled magnetic tape file when you specify a tape drive using either the device name option or device class option of HPFOPEN/FOPEN.
Writing to a File Writing to a Magnetic Tape File Example 8-6. Writing to an Unlabeled Magnetic Tape File . . . var control_code : 0..65535; record_length: shortint; file_record : record_type; . . . record_length:= -256; control_code := 0; FWRITE ( unlabeled_tape_file, file_record record_length control_code ); {Declare FWRITE parm. {Declare FWRITE parm {Record to be written to file; {record_type is 256-byte {fixed-length record. } } } } } {Number of bytes in record.
Writing to a File Writing a File Label to a Labeled Tape File record_length control_code ); {Size of file_record. {Required, but ignored. if ccode = CCL {check FWRITE condition code then handle_file_error (labeled_tape_file); . . . } } } If the FWRITE intrinsic encounters an error condition (CCL), an error handling procedure handle_file_error is invoked. FWRITE returns a CCG condition code if the EOF is reached.
Writing to a File Writing User Data in ANSI Labels for counter := 1 to 80 do {Loop to fill array with } user_label [counter] := ' '; {ASCII blanks. } user_label := 'tape01 user header label no. 1'; {Overwrite first } {30 bytes with label name } FWRITELABEL (labeled_tape_file, user_label, label_length ); {Required parameter {Required parameter {Optional parameter } } } if ccode = CCL or CCG {check FWRITELABEL condition code then handle_file_error (labeled_tape_file); . . .
9 Reading from a File This chapter describes, through program examples, various ways that you can use file system intrinsics to transfer data to your program from a disk file or device file. This chapter is intended to illustrate topics introduced in chapter 7, "Record Selection and Data Transfer".
Reading from a File Sequential Access and Random Access Sequential Access and Random Access Two of the most frequently used methods of transferring data from a file to your program are sequential access and random access. When you use sequential access to read data from a file, you read data from the record currently pointed to by the record pointer. You use the FREAD intrinsic to read data sequentially from a disk file or device file.
Reading from a File Sequential Access and Random Access end_of_file := false; expected_length := -256; control_code := 0 repeat record_length := FREAD ( {initialize exit condition {record size of file {set to default } } } {begin loop disk_file, {file number from HPFOPEN record, {data transferred to here expected_length {record size of file } } } } ); if ccode = ccl then handle_file_error (disk_file) {error check } else if ccode = ccg then end_of_file ;= true {exit condition check} else begin FWRITE(
Reading from a File Sequential Access and Random Access record_length := -30; record_number := 0; end_of_file := false; {file record size 30 bytes } {initialize variable } {initialize exit condition } repeat {begin loop } select_record (record_number); read_length := FREADDIR (data_file, {HPFOPEN file number } record, {record read from data_file } record_length,{expected length of record } record_number {returned from select_record } ); if ccode = ccl then handle_file_error (data_file) {error check } else
Reading from a File Reading From $STDIN Reading From $STDIN You can read data from your program's standard input device ($STDIN) by using one of the following intrinsics: • READ • READX • FREAD The job/session input device is the source of all MPE/iX commands relating to a job or session and is the primary source of all ASCII information input to the job or session. You can read a string of ASCII characters from the job/session input device into an array in your program with the READ and READX intrinsics.
Reading from a File Reading From a Magnetic Tape File massage :='Please input a valid file reference'; {specify prompt } length := -35; {length of prompt } control_code := 0 {default condition } expected_length := -80 PRINT (message, length, control_code ); if ccode <> cce then handle_file_error; else begin read_length := READ ( file_name, {read data to output parm} expected_length {length of file_name } ); if ccode <> cce then handle_file_error; end end; If an error is encountered by either READ or PRINT,
Reading from a File Reading a File Label from a Labeled Tape File record_length := FREAD (tape_file_num, record, length); if ccode = ccl then handle_file_error (tape_file, 3) else if ccode = ccg then {FREAD returns ccg if EOF } end_of_file := true {exit condition encountered } else begin FWRITE( disk_file_num, {identity returned by HPFOPEN } record, {read from tape_file_num } record_length, {actual size of record } control_code {default } ); if ccode <> cce then {check condition code for error} handle_file
Reading from a File Reading a File Label from a Labeled Tape File FREADLABEL ( data_file, {file number of tape file} label, {returns label } length {# of halfwords to read} ); if ccode <> cce then handle_file_error (data_file); FWRITE ( list_file, {output to $STDLIST } label, {label read by FREADLABEL } length, {length of label } control_code {default condition } ); if ccode <> cce then handle_file_error (list_file); end; {end read_user_label } If an error is encountered by either FREADLABEL or FWRITE, pro
10 Updating a File You can use the FUPDATE intrinsic to update a logical record of a disk file. FUPDATE affects the last logical record (or block for NOBUF files) accessed by any intrinsic call for the file named, and writes information from a buffer in the stack into this record. Following the update operation, the record pointer is set to indicate the next record position.
Updating a File { procedure update_disk_file updates records in the disk file } { with the replacement records read from $STDIN } {**************************************************************} var dummy inbuf end_of_file read_length : : : : integer; array [1..
Updating a File In appendix A, "HP Pascal Program Examples," example A-5 is an HP Pascal/iX program that uses the procedure in example 10-1 to update records in a disk file. For more information about FUPDATE parameters, refer to the MPE/iX Intrinsics Reference Manual. NOTE Chapter 10 A magnetic tape device is not designed to enable the update/replacement of a single record in an existing file.
Updating a File 140 Chapter 10
11 Accessing a File Using Mapped Access A major enhancement to the MPE/iX file system is mapped file access, a method that allows you to access a file directly through memory load and store instructions. Mapped file access is available through three HPFOPEN intrinsic optional parameters: • Item #18 short-mapped option returns a 32-bit value of type address. • Item #21 long-mapped option returns a 64-bit value of type address. • Item #87 large-mapped option returns a 64-bit value of type address.
Accessing a File Using Mapped Access How to Access a File Mapped How to Access a File Mapped You can access a file mapped by declaring a short (32-bit) or long (64-bit) pointer variable within a program and passing that variable to the appropriate HPFOPEN option. The HPFOPEN intrinsic returns the variable pointing to the beginning of the data area of the opened file. After HPFOPEN returns the address of the file, you simply reference the pointer as an array.
Accessing a File Using Mapped Access How to Access a File Mapped FCLOSE intrinsic disposition parameter, bit 10:1 set to 1 will force the EOF to the file limit. This overcomes the problem of trying to FPOINT to the file limit. Advantages of mapped access Mapped access to a file can be much faster than access through normal file system intrinsics. This is especially the case when you are accessing a smaller file randomly rather than sequentially.
Accessing a File Using Mapped Access Opening a File Mapped access to large amounts of shared virtual memory. You can use the pointer as a large array of any type to efficiently access the file. A file created using the long-mapped option can be up to 4GB - 64KB in size. There is no practical limit of the number of long-mapped access files that a process can have open at a time. You cannot access a loaded program file or a loaded library file using either mapped access option.
Accessing a File Using Mapped Access Opening a File Mapped a_record : packed array [1..80] of char; end; file_t = array [1..50000] of record_t; {** define a 4,000,000 byte array **} var access,domain : integer; dummy : shortint; file_name : packed array [1..
Accessing a File Using Mapped Access New Intrinsics {** re-open the same short-mapped file **} HPFOPEN ( file_number, status, file_name_option, file_name, domain_option, domain_OLD, short_mapped_option, file_ptr, ); {** retrieve some data you put in file **} for rec := 1 to 100 do begin write ('Record-', rec:4, ' '); for index := 1 to 20 do write (file_ptr^[rec].
Accessing a File Using Mapped Access New Intrinsics return_ptr 64-bit pointer by reference (required) The return_ptr is an output parameter that will have the new pointer value returned to it. It can be a 64-bit pointer to an object of any type status 32-bit signed integer by reference (optional) Returns the status of the HPFADDTOPOINTER call. If no errors or warnings are encountered, status returns 32 bits of zero. If errors or warnings are encountered, status is interpretted as two 16-bit fields.
Accessing a File Using Mapped Access New Intrinsics Returns the status of the HPFFILLDATA call. If no errors or warnings are encountered, status returns 32 bits of zero. If errors or warnings are encountered, status is interpretted as two 16-bit fields. Bits (0:16) comprise status.info. A negative value indicates an error condition, and a positive value indicates a warning condition. Bits (16:16) comprise status.subsys. The value represents the subsystem that set the status information.
Accessing a File Using Mapped Access New Intrinsics Returns the status of the HPFMOVEDATA call. If no errors or warnings are encountered, status returns 32 bits of zero. If errors or warnings are encountered, status is interpretted as two 16-bit fields. Bits (0:16) comprise status.info. A negative value indicates an error condition, and a positive value indicates a warning condition. Bits (16:16) comprise status.subsys. The value represents the subsystem that set the status information.
Accessing a File Using Mapped Access New Intrinsics Returns the status of the HPFMOVEDATALTOR call. If no errors or warnings are encountered, status returns 32 bits of zero. If errors or warnings are encountered, status is interpretted as two 16-bit fields. Bits (0:16) comprise status.info. A negative value indicates an error condition, and a positive value indicates a warning condition. Bits (16:16) comprise status.subsys. The value represents the subsystem that set the status information.
Accessing a File Using Mapped Access New Intrinsics Returns the status of the HPFMOVEDATARTOL call. If no errors or warnings are encountered, status returns 32 bits of zero. If errors or warnings are encountered, status is interpretted as two 16-bit fields. Bits (0:16) comprise status.info. A negative value indicates an error condition, and a positive value indicates a warning condition. Bits (16:16) comprise status.subsys. The value represents the subsystem that set the status information.
Accessing a File Using Mapped Access New Intrinsics 152 Chapter 11
12 Sharing a File Accessing and controlling a file that is open only to you is a relatively simple matter. When your file is being accessed by several users simultaneously, each user must be aware of special considerations for this shared file. As you read this chapter, keep these considerations in mind: • How will others be allowed concurrent access to your file? • Will the concurrent access need special management? NOTE In most cases, the following discussions pertain only to non-message files.
Sharing a File Simultaneous Access of Files action taken depends upon the current use of the file versus the access requested. Table 12-1. File Sharing Restriction Options ACCESS RESTRICTION FILE\ PARAMETER DESCRIPTION Exclusive Access EXC After file is opened, prohibits concurrent access in any mode through another HPFOPEN/FOPEN request, whether issued by this or another program, until this program issues FCLOSE or terminates.
Sharing a File Simultaneous Access of Files Figure 12-1. Requested Access Granted, Unless Noted Semi-exclusive access This option allows other accessors to read the file, but prevents them from altering it. When appending new part numbers to a file containing a parts list, for instance, you might use this option to allow other users to read the current part numbers at the same time that you are adding new ones to the end of the file.
Sharing a File Simultaneous Access of Files To use Write access most effectively with shared files, specify the multiaccess option as discussed below. To request share access for a file, use the SHR parameter in the FILE command, as follows: FILE RDFILE;SHR RUN RDPROG <---- Requests shared access Multiaccess This option extends the features of the share access option to allow a deeper level of multiple access.
Sharing a File Sharing the File Using FLOCK and FUNLOCK Sharing the File Using FLOCK and FUNLOCK Sharing a file among two or more processes may be hazardous. When a file is being shared among two or more processes and is being written to by one or more of them, care must be taken to ensure that the processes are properly interlocked.
Sharing a File Sharing the File Using FLOCK and FUNLOCK 158 Chapter 12
13 Maintaining File Security MPE/iX provides two methods of establishing and maintaining file security. • access control definitions (ACD) for file and devices • traditional file security for disk files only ACDs are implemented to provide a security mechanism that meets standards set forth by the National Computer Security Center. Traditional file security works through the mechanism long available on MPE systems. ACDs override any security measures implemented by traditional means.
Maintaining File Security Access Control Definition Security (ACD) Files the owner of a file is any one of these three users: • The creator of the file with which an ACD is associated • The user who as am capability in the account in which the file resides • The user who has sm capability on the system in which the file resides Devices The System Manager (SM) is the owner of all of the devices on a system.
Maintaining File Security Access Control Definition Security (ACD) X Execute NONE None RACD Read and copy the ACD permission file You could define an ACD as follows: ACD = (R,W:MGR.ACCTING, DENNIS.LEE; R:@.PAYROLL; A:@.@) The users MGR.ACCTING and DENNIS.LEE can read and write to the file associated with this example ACD. Anyone in the PAYROLL account can read it, and anyone on the system can append to it. For example, no one but DENNIS.
Maintaining File Security Access Control Definition Security (ACD) of ACD attributes. HPACDINFO Returns security attributes. HPFOPEN Permits the creation of of an ACD. The intrinsic FOPEN cannot be modified to give it the option of creating an ACD. You must use HPFOPEN. Detailed discussions of these intrinsics are found in the MPE/iX Intrinsics Reference Manual. Preserving ACDs Device ACDs are not permanent objects; you must redefine them every time that the system is rebooted.
Maintaining File Security Access Control Definition Security (ACD) var status filename ACD : integer; : packed array [1..28] of char; : packed array [1..256] of char; procedure HPACDPUT;intrinsic; begin filename := 'TARGET'; ACD := '(x:@.@;r,w:mgr.sys)' ACD[20] := #m; HPACDPUT(status, 1, filename, 20, ACD) if status <> 0 then writeln('HPACDPUT failed. Status = ', status); end.
Maintaining File Security Access Control Definition Security (ACD) To restore all of the files on tape and copies the ACD attributes of the file to disk, enter this: FILE T;DEV=TAPE RESTORE *T;@;KEEP;SHOW;COPYACD COPYACD is the default. NOACD prevents the copying of the ACD attributes. — SM and OP can restore any ACD-protected file on the system. — AM can restore any ACD-protected file in the manager's account.
Maintaining File Security Access Control Definition Security (ACD) FOR XX.DESIGN: NONE (Other ACD status reports are NO ACD and ACD CORRUPTED.) The LISTFILE command with option -2 gives a detailed ACD report on a file in this fashion: LISTFILE FILEA,-2 FILE = FILEA ************** ACD ENTRIES ************** SAM.DOE JOE.DOE @.DESIGN @.
Maintaining File Security Access Control Definition Security (ACD) Copying ACDs Command Intrinsic ;COPYACD parameter of the ALTSEC command Purpose Copy an ACD from one file to another Examples To copy the ACD associated with FILEB to FILEA, enter this: ALTSEC FILEA.XX.DESIGN;COPYACD=FILEB.XX.DESIGN Only an owner, or a user granted RACD (read ACD) authorization, can copy the ACD from FILEB.
Maintaining File Security Access Control Definition Security (ACD) ALTSEC FILEA.XX.DESIGN;DELPAIR(NONE:@.DESIGN) To deny OPERATOR.SYS any access to LDEV 7, enter this: ALTSEC 7,LDEV;DELPAIR=(R,W:OPERATOR.SYS) Only an owner can delete an ACD associated with a file. Only the system manager can delete an ACD associated with a device.. Migrating ACDs Device ACDs should not be migrated, because they are tied to their system's configuration.
Maintaining File Security Access Control Definition Security (ACD) Table 13-1.
Maintaining File Security Access Control Definition Security (ACD) Log of system logging configuration This log gives you an audit trail of changes to the logging configuration. This log is initially enabled (ON). The following is the log record format: Table 13-2.
Maintaining File Security Access Control Definition Security (ACD) Table 13-3. Type 136 Record Format Length, in 16-bit words Record Content 8 Creator 17 Volume identification 1 Access type 8 User name 8 Group name 8 Account name 8 job or session name Log of printer access failure This log keeps track of failed attempts attaching spool files to printers. New spool files, which are logged by FOPEN as event #144, are not logged here.
Maintaining File Security Access Control Definition Security (ACD) Table 13-4.
Maintaining File Security Access Control Definition Security (ACD) Log of stream initiation This log records the name of a streamed job, its number, the user that initiates it (and the logon), and the scheduled date and time. This log is initially disabled, but can be enabled by SYSGEN followed by a START command. Table 13-5.
Maintaining File Security Access Control Definition Security (ACD) Log of user logging This log keeps a record of all OPENLOG and CLOSELOG intrinsic calls. The system manager can use it to see who accesses, or tries to access, the user logging facility. This log is initially disabled, but can be enabled by SYSGEN followed by a START command. Table 13-6.
Maintaining File Security Access Control Definition Security (ACD) Table 13-7.
Maintaining File Security Access Control Definition Security (ACD) parameters is the wildcard @. For example, to select log records from log files 1 through 5, with log information about password changes (log type 134), and user identification JTEST,MARIA.PAYROLL, you would enter the following.
Maintaining File Security Access Control Definition Security (ACD) Logging begins whenever the system is rebooted; however, not all events are automatically enabled. Some, including those listed above, are initially disabled. You can, however, request that a new file be started. To keep a certain type of log, the system operator or system manager must change its status to ON (configure it) in SYSDIAG. To see log records displayed, call the LOGTOOL utility from SYSGEN.
Maintaining File Security Access Control Definition Security (ACD) The following is the log record format: Table 13-8.
Maintaining File Security Access Control Definition Security (ACD) — PIN • log information — the identification of the user who changed the ACD: job or session name, user name, group name, and account name — the object type and object name whose ACD was changed — the object type and object name from which the ACD was copied — the type of change to the ACD: create, add pair, replace pair, copy, delete pair, delete — the program file name from which the ACD change was executed.
Maintaining File Security Traditional Mechanism for File Security Table 13-9. Type 138 Record Format length, in 16-bit words Record Content 8 Account name 8 job or session name Traditional Mechanism for File Security The traditional security mechanism (file access matrix and lockwords) associates with each account, group, and individual files a set of security provisions that specifies any restrictions on access to the files in that account or group, or to that particular file.
Maintaining File Security Traditional Mechanism for File Security file contains 10 logical records of data (numbered 0 through 9). The table shows that the current end-of-file (EOF) lies at Record 10 before the file is opened, indicating that if another record were appended to the file, that would be the eleventh record. When you open the file in the Write-only mode, however, all records presently in the file are deleted and the logical record pointer and current EOF move to record 0.
Maintaining File Security Traditional Mechanism for File Security time, but wish to correct some of the data in the file rather than delete it. You could use the FILE command to override the programmatic specification, opening the file for update access: FILE REPFILE; ADD=UPDATE RUN PROGN \ Requests update access Table 13-11.
Maintaining File Security Traditional Mechanism for File Security Table 13-12. User Type Definitions (Traditional Security) USER TYPE MNEMONIC CODE MEANING Group Librarian User GL User with Group Librarian capability, who can manage certain files within his home group. Creating User CR The user who created this file. Group User GU Any user allowed to access this group as his logon or home group, including all GL users applicable to this group.
Maintaining File Security Traditional Mechanism for File Security • any user (ANY) • account member (AC) If no security provisions are explicitly specified for the account, the following provisions are assigned by default: • For the system account (named SYS), through which the system manager user initially accesses the system, reading and executing access are permitted to all users; appending, writing, and locking access are limited to account members.
Maintaining File Security Traditional Mechanism for File Security • account member (AC) If no security provisions are explicitly specified, the following provisions apply by default: • For a public group (named PUB), whose files are normally accessible in some way to all users within the account, reading and executing access are permitted to all users; appending, writing, saving, and locking access are limited to account librarian users and group users (including group librarian users).
Maintaining File Security Traditional Mechanism for File Security account. Table 13-13. Default Security Provisions (Traditional) FILEREFEREN CE FILE ACCESS\PERMI TTED SAVE ACCESS\TO GROUP filename.PUB. SYS Any file in public group of system account (R,X:ANY; W:AL,GU) AL,GU filename. groupname. SYS Any file in any group in system account (R,W,X:GU) GU filename .PUB. accountname Any file in public group of any account (R,X:AC; W:AL,GU) AL,GU filename. groupname.
Maintaining File Security Traditional Mechanism for File Security You always retain the ability to change the security provisions of a file that you have created, even when you are not allowed to access the file in any mode; thus, you can even change the provisions to allow yourself access. Suspending and restoring security provisions You may temporarily suspend the suspending and restoring security:files| security restrictions on any disk file that you create.
14 Getting File Information 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 this chapter to obtain file information for a variety of purposes.
Getting File Information Displaying General File Information Displaying General File Information Some questions that you may wish to answer in this section include • Does a file by this name exist in my account or group? • How large is this file? • When and by whom was this file created? • What security provisions exist for this file? You can use this information in an interactive context, or you can use commands and intrinsics within an executing program to obtain and utilize the information.
Getting File Information Displaying General File Information Specifying the list level If you do not indicate otherwise, LISTFILE displays only the unqualified file name. You can optionally direct LISTFILE to display more detailed information about the file(s) that you specify, depending upon the parameter value that you specify in the command, as listed in Table 14-1. on page 189 Table 14-1. Format Selection Option Name Displayed Information −2 ACD Displays the file's ACD (access control definition).
Getting File Information Displaying General File Information Table 14-1. Format Selection Option Name Displayed Information 8 ACCESS Shows all accessors for the file 9 LOCKS Shows all format 8 data plus more details about the proecsses accessing the file, including locking data. 10 SUMMARY WIDE The same basic information as in the SUMMARY option, but in a wider format to allow for larger values.
Getting File Information Displaying General File Information NUM EXT: 4 MAX REC: 31250 NUM LABELS: MAX LABELS: DISC DEV -: CLASS : SEC OFFSET: EXECUTE : ANY **SECURITY IS ON FLAGS : n/a CREATED : TUE, JUN 3, 1986, 9:47 AM MODIFIED: TUE, JUN 3, 1986, 9:48 AM ACCESSED: WED, JUN 4, 1986, 2:38 PM LABEL ADDR: $00000010 $00004414 0 0 0 DISC 0 4. Obtain a detailed ACD report on a file: LISTFILE FILEA,-2 FILE = FILEA ************** ACD ENTRIES ************** SAM.DOE JOE.DOE @.DESIGN @.
Getting File Information Displaying General File Information :listfile .
Getting File Information Displaying General File Information Access ERWS FCode RecSiz Type EOF File Limit Disk Usage KB Exts Name NMOBJ 256 FB 22 4000 8 1 YRAND The display for the format options 10 and 11 is the same for each of the LISTF, LISTFILE, and LISTFTEMP commands. One of the unique additions of these two new options is the the "ERWS" column. This column indicates whether or not the file is currently opened, and if so, for what type of access.
Getting File Information Retrieving Specific File Information Retrieving Specific File Information The LISTFILE, LISTFILE...;TEMP and LISTEQ commands return formatted information to your job or session list device. If you need to retrieve specific information about a particular file, and you wish to place it in a variable available either to your CI or to your program, then you'll be interested in the the CI evaluator function and intrinsics described below.
Getting File Information Retrieving Specific File Information Table 14-2. FINFO Options Specify: FINFO returns: 14 Record size (negative value indicates bytes) 15 Block size 19 EOF marker location 24 Last modified time in format (hh:mm am/pm) -24 Last modified time in format (hhmmss) 33 Lockword For a more complete list of items that FINFO supports, type HELP FINFO at your terminal.
Getting File Information Retrieving Specific File Information Here is an example of an FFILEINFO intrinsic call.
Getting File Information Determining Interactive/Duplicative Files with FRELATE FLABELINFO The FLABELINFO intrinsic returns information from the file label of a disk file. The file need not be opened at the time of the intrinsic call. The information returned by this intrinsic is a subset of the information returned by FFILEINFO. Here is an example of a FLABELINFO intrinsic call that returns the same information as the FFILEINFO and FGETINFO examples shown above: FORMALDESIGNATOR:='MYFILE.MYGROUP.
Getting File Information Displaying File Error Information The intrinsic returns a 16-bit unsigned integer. If the files are an interactive pair, bit (15:1) =1, or =0 if they are not. If the files are a duplicative pair, bit (0:1) =1, or =0 if they are not. A file can be interactive, duplicative, or both. These attributes do not change between the time the files are opened and the time they are closed. You can use FRELATE to obtain information about files on all devices.
Getting File Information Displaying File Error Information FERRMSG This intrinsic is used following a call to FCHECK, to return an error message explaining the nature of a file system error. It has three required parameters: errorcode is the error number returned by FCHECK, msgbuf returns the error message, and msglgth returns the length of the error message returned in msgbuf. This example shows a call to FCLOSE.
Getting File Information Displaying File Error Information +-F-I-L-E---I-N-F-O-R-M-A-T-I-O-N---D-I-S-P-L-A-Y+ ! FILE NAME IS TREEFILE.PSMG.
Getting File Information Displaying File Error Information Table 14-3. PRINTFILEINFO Information Line # Meaning 15 NUMBER WRITERS is the number of FOPEN calls of the file with some type of WRITE access. NUMBER READERS is the number of FOPEN calls to the file with READ access. This field applies only to message files; it does not appear for other files. 16 The error number and residue. 17 The block number and number of records (NUMREC) for the file.
Getting File Information Displaying File Error Information 202 Chapter 14
A Pascal/XL Program Examples The HP Pascal/XL program examples in this appendix are provided to help you better understand how to use MPE/iX file system intrinsics to perform common file access tasks.
Pascal/XL Program Examples 3. Close (FCLOSE) the tape file and the disk file (see procedure close_file). If a file system intrinsic returns an unsuccessful condition code, procedure handle_file_error is called to print file information and then abort the program. Source code listing Example A-1.
Pascal/XL Program Examples procedure handle_file_error ( file_num : shortint; quit_num : shortint ); {************************************************************************} { procedure handle_file_error is invoked when a file system intrinsic } { returns and unsuccessful condition code. File information is printed } { to $STDLIST, then the program aborts.
Pascal/XL Program Examples procedure open_file ( var file_num file_name domain access ); : : : : integer; pac80; integer; integer {************************************************************************} { procedure open_file acts as a generic file open procedure allowing } { you to specify the domain option and the access type option } {************************************************************************} const {**define HPFOPEN item numbers**} formal_designator_option domain_option access_type_o
Pascal/XL Program Examples inbuf : pac80; end_of_file : boolean; read_length : integer; begin end_of_file := false; repeat {**In a loop, do a simple sequential read from tape file to ***} {**disk file.
Pascal/XL Program Examples Program Example A-2 begin open_unlabeled_tape_file (tape_file); filename := '&$stdlist&'; open_file (std_list, filename, permanent,write); filename := '&dataone&'; open_file (disk_file, filename, new,update); copy_tapefile_to_discfile(tape_file,disk_file); close_file(disk_file, save_temp); close_file(tape_file, save_perm); end.
Pascal/XL Program Examples Program Example A-2 • allow the user to specify an alternative file name if, during an FCLOSE call, the file system determines that a duplicate permanent disk file exists (see procedure handle_fclose_error). • print file information (PRINTFILEINFO) before aborting (QUIT) the program (see procedure handle_file_error). Using these four error procedures, the program individually tailors error-handling routines to meet different intrinsic needs. Source code listing Example A-2.
Pascal/XL Program Examples Program Example A-2 procedure FREADLABEL; intrinsic; procedure print_hpfopen_error ( error : status_type ) option inline; {************************************************************************} {* PURPOSE: *} {* This routine prints the status returned by HPFOPEN.
Pascal/XL Program Examples Program Example A-2 {* This routine displays File System information about a file *} {* and then calls QUIT to terminate the program. *} {* PARAMETERS: *} {* file_num (input) *} {* - file number. The routine will print info about this *} {* file. *} {* quit_num (input) *} {* - quit number. This number will be displayed by QUIT when *} {* the program is terminated.
Pascal/XL Program Examples Program Example A-2 {* file_num (output) *} {* - file number of open tape file *} {************************************************************************} const {* define HPFOPEN item numbers *} formal_designator_option domain_option tape_label_option access_type_option tape_type_option tape_expiration_option device_class_option = = = = = = = 2; 3; 8; 11; 30; 31; 42; var {* define HPFOPEN items *} read_only device_class old file_name tape_label ansi_tape tape_expiration : :
Pascal/XL Program Examples Program Example A-2 {************************************************************************} {* PURPOSE: *} {* This routine prompts the user for a file name and opens a *} {* NEW disk file using the given name.
Pascal/XL Program Examples Program Example A-2 if status.all <> 0 then begin print_hpfopen_error (status); handle_file_error (file_num, 2); end; end; {* check for error condition *} {* open_disk_file * } procedure print_user_label ( file_num : integer ); {************************************************************************} {* PURPOSE: *} {* This routine reads the user label from the tape file and *} {* then prints the user label to $STDLIST.
Pascal/XL Program Examples Program Example A-2 inbuf msgbuf end_of_file read_length : : : : pac80; pac80; boolean; integer; begin end_of_file := false; {* copy_file_from_tape_to_disk *} repeat {* copy a buffer from the tape file to the disk file until the *} {* end of the tape file is reached *} {*********************************************************************} read_length := FREAD (tape_file, inbuf, 40); {* read buffer from tape if ccode = ccl then *} {* check for error condition *} begin msg
Pascal/XL Program Examples Program Example A-2 msgbuf : pac80; begin {* close_tape_file *} FCLOSE (file_num, 1, 0); {* close file, rewind and unload tape*} if ccode = ccl then {* check for error condition *} begin msgbuf := 'Can''t close tape file'; PRINT (msgbuf, -21, 0); print_fserr (file_num); handle_file_error (file_num, 6); end; end; { close_tape_file } procedure close_disk_file ( file_num : integer ); {************************************************************************} {* PURPOSE: } {* This r
Pascal/XL Program Examples Program Example A-3 } close_tape_file (tape_file); close_disk_file (disk_file); end.
Pascal/XL Program Examples Program Example A-3 { DECLARATION PART } {***********************************************************************} const ccg ccl cce permanent new temp delete = = = = = = = type pac256 pac80 { condition code warning/EOF,/etc.. } { condition code error } { condition code successful } = packed array [1..256] of char; = packed array [1..
Pascal/XL Program Examples Program Example A-3 var file_num : integer; file_name : pac80; domain : integer ); {***********************************************************************} {procedure open_disk_file is a generic file open procedure that allows } {you to specify the file name, it's domain, type of access, and internal} {format - ASCII or binary.
Pascal/XL Program Examples Program Example A-3 end; { end write_user_label } procedure copy_oldfile_to_newfile ( new_discfile : integer; old_discfile : integer ); {************************************************************************} { procedure copy_oldfile_to_newfile gets EOF of old file & assigns record} { pointer to that value. In a loop, sequentially reads from old file; } { random access writes to new file.
Pascal/XL Program Examples Program Example A-4 {************************************************************************} { procedure close_disk_file is a disk file closing procedure that allowsa } { you to specify the final disposition of the file you are closing.
Pascal/XL Program Examples Program Example A-4 (see procedure read_user_label). 3. In a loop, read (FREADDIR) even numbered records from the disk file. Before writing (FWRITE) the records to disk, prefetch the next record (FREADSEEK). Do this till EOF of the disk file is reached (see procedure read_from_datafile). 4. Close (FCLOSE) both files (see procedure close_files).
Pascal/XL Program Examples Program Example A-4 begin printfileinfo (filenum); quit (quitnum); end; {end error_handler } procedure open_files; {************************************************************************} { procedure open_files opens the data file and $STDLIST using the FOPEN } { intrinsic.
Pascal/XL Program Examples Program Example A-5 { selection, then sequential write { to $STDLIST, till EOF.
Pascal/XL Program Examples Program Example A-5 Program Algorithm The task specified above is accomplished by following the steps described below. Also indicated are the intrinsics used to accomplish file access tasks and the name of the procedure where the task is accomplished: 1. Open (HPFOPEN) three files, $STDLIST, $STDIN, and a permanent disk file containing data to update (see procedure open_file). 2.
Pascal/XL Program Examples Program Example A-5 subsys 1 : (all end; var disk_file filename std_list std_in outbuf : : : : : : shortint); : integer); integer; pac80; integer; integer; pac80; function FREAD: shortint; intrinsic; procedure HPFOPEN; intrinsic; procedure FCLOSE; intrinsic; procedure FWRITE; intrinsic; procedure FWRITEDIR; intrinsic; procedure FUNLOCK; intrinsic; procedure PRINTFILEINFO; intrinsic; procedure FLOCK; intrinsic; procedure FUPDATE; intrinsic; procedure QUIT; intrinsic; { { { { {
Pascal/XL Program Examples Program Example A-5 } { exclusive options for the file.
Pascal/XL Program Examples Program Example A-5 end_of_file := false; FLOCK (old_discfile,1); if ccode = ccl then handle_file_error (old_discfile, 3); repeat { Read record from disk file, write employee name to $stdlist { and read corresponding record number from $stdin and update { the disk file with the input record and unlock disk file.
Pascal/XL Program Examples Program Example A-5 {*************************************************************************} { MAIN PROGRAM } {*************************************************************************} begin filename := '&$stdlist&'; open_file (std_list, filename, permanent,write,0,0); { STEP filename := '&$stdin&'; open_file (std_in, filename, permanent,read,0,0); { STEP filename := '&dataone&'; open_file (disk_file, filename, permanent,update,shared,locking);{STEP update_file(disk_file); {
Pascal/XL Program Examples Program Example A-5 230 Appendix A
Index A aborting NOWAIT I/O, 19 access exclusive, 154 modes, 179, 180 multi, 153, 156, 157 random, 119, 130, 131 restricting, 179 restricting by type, 181 restricting by user, 181 semi-exclusive, 155 sequential, 119, 130 shared, 156 simultaneous, 153 access control definitions (ACD), 159, 178 accessing files, 18, 48, 51 files, remote, 84 account security, 182 ACD adding, 166 changes, logging, 177 commands related to, 161, 162 copying, 166 creating, 162 deleting, 166 device owners, 160 file owners, 160 intr
Index jobs and, 15 opening, 99 sessions and, 15 device owners acds, 160 devices ASCII transmission, 70 binary transmission, 70 EBCDIC transmission, 70 files, 15 peripheral, 13, 14 programs, 14 shareable, 18, 48 spooled, 15 directories, searching, 89 disk files, 15, 56 closing, 105, 107 opening, 94, 96 disk volume specifying restrictions, 63 displaying file equations, 193 file error information, 198 file information, 187 domains changing, 89 new files, 87 permanent files, 88 temporary files, 87 duplicative
Index multi access, 153, 156, 157 multi access, global, 156 names, 14, 73 nonshareable, 15 opening, 91, 94, 102 output, 14 overrides, 55 parsing designators, 84 passed, 79, 81 passing, 79 peripheral devices, 14, 15, 56 permanent, 106, 188 predefined, 75 qualified, 74 random access, 121 reading from, 129, 136 record structure, 14, 18 records, 14 referencing, 73 reserved codes, 64, 69 rewinding, 115 RIO, 59 saving, 89 searchign directories, 89 security, 159, 184, 186 security, ACD, 159, 178 security, traditi
Index lockwords changing, 75 files, 74, 75 removing, 75 log files specifying number of records, 69 logging ACD changes, 177 file security events, 175 password changes, 176 printer access failure, 170 process creation, 173 restores, 169 stream initiation, 172 system events, 167 system logging configuration, 169 user, 174 user logging, 173 long-mapped access, 144 M magnetic tape, 115, 117 default (file) record size, 62 files, 56, 100 marker, 115 writing to, 125, 128 managing ACDs, 161, 162 mapped access adva
Index plotter files default record size, 62 pointing to a record, 114 predefined files, 75 preserving ACDs, 162 printer access failure, logging, 170 procedure file system error check, 201 process creation, logging, 173 programmable controller files default record size, 62 programs devices, 14 Q qualified file names, 74 R random access, 119, 130, 131 record selection, 111 reading from files, 129, 136 tapes, 134 record pointers moving, 114 records comparison of, 58 default sizes, 62 files and, 14 first, rewi
Index record format, 56 record size, 61, 62 storage format, 70 specifying file domain, 87, 90 spooled devices, 15 spooling console operator, 15 user, 15 standard files, 59 input files, 77 output files, 77 storage formats, 70 specifying, 70 stream initiation, logging, 172 suspending security, 186 synchronous single-line controller files default record size, 62 system events, logging, 167 system-defined files, 72, 77, 81, 97 designators, 77 opening, 97, 98 logging, 174 logging, logging, 173 spooling, 15 use