Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Pascal/HP-UX Programmer's Guide > Chapter 3 Input/Output

Introduction

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Input/output depends on files: your program reads input from files and writes output to files. The terms that describe the three varieties of input/output — sequential, textfile, and direct — also describe the associated files.

This chapter:

  • Gives general information about files.

  • Explains the predefined file-opening procedures and how they determine whether files are sequential or direct, for input or for output.

  • Defines sequential as it applies to input/output and files, and explains the predefined routines that support sequential I/O.

  • Explains textfile input/output and files, which are subsets of sequential I/O and files (respectively), and explains the routines peculiar to them.

  • Defines direct as it applies to input/output and files, and explains the predefined routines that support direct I/O.

  • Gives the conditions under which files are closed, and tells what happens when a file closes.

Figure 3-1 “Relationships Between I/O Varieties and File Types ” illustrates the relationships between sequential, textfile, and direct input/output and sequential files, textfiles, and direct files.

Figure 3-1 Relationships Between I/O Varieties and File Types

Relationships Between I/O Varieties and File Types

Input/output also depends upon the procedures that manipulate files and the functions that return information about them.

Table 3-1 “Categories of Input/Output Routines ” categorizes the predefined input/output routines two ways: by purpose (for example, input or output) and by I/O type (sequential, textfile, or direct).

Table 3-1 Categories of Input/Output Routines

Sequential I/O

Textfile I/O

Direct I/O

Opening Procedures

  • reset

  • rewrite

  • append

  • reset

  • rewrite

  • append

  • open

Input Procedures

  • get

  • read

  • get

  • read

  • readln

  • get

  • read

  • readdir

Output Procedures

  • put

  • write

  • put

  • write

  • writeln

  • page

  • prompt

  • overprint

  • put

  • write

  • writedir

Positioning Procedure

None

None

seek

Association Procedures

  • associate

  • disassociate

  • associate

  • disassociate

  • associate

  • disassociate

Status Functions

  • eof

  • position

  • eof

  • eoln

  • linepos

  • eof

  • lastpos

  • maxpos

  • position

Closing Procedure

close

close

close

 

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.