HPlogo Asynchronous Serial Communications Programmer's Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 8 Intrinsics Reference

FCLOSE

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

Closes a file.

Syntax

        I16V    I16V        I16V
FCLOSE(filenum,disposition,securitycode);

Use

The FCLOSE intrinsic terminates access to a file. You should make sure your program issues an FCLOSE for every file it opens. If you have opened multiple files against the same device, you should issue an FCLOSE for each opened file before your program ends. If you should fail to issue an FCLOSE, however, MPE/iX will automatically issue an FCLOSE for any files left open when your process terminates.

Certain device control actions are taken by the device control software at every call to FCLOSE, as shown in Table 8-3 “Device Control Action at FCLOSE”. This means that if you have programmatically altered one of these device settings (through the programmatic control listed in the table), the device will return to the system default setting at FCLOSE.

You should note that Table 8-3 “Device Control Action at FCLOSE” shows only those control actions taken by the device control software. Additional changes may result from actions taken by other software modules. For example, should your program disable the system break feature, break will be reenabled on FCLOSE by the Command Interpreter software.

Table 8-3 Device Control Action at FCLOSE

FCLOSE ActionRelated Programmatic Control
Disable Read TimeoutValue set by FCONTROL(4)
Disable Subsystem BreakEnabled through FCONTROL(17)
Enable Printing !!! on the deletionPrinting !!! disabled through FCONTROL(35)
Disable Transparent EditingEnabled through FCONTROL(41)

 

For most other device settings that can be programmatically altered, you are responsible for making sure that the altered characteristics are returned to their original settings when your program ends or for assuring that the altered characteristics define the way you want the device to act. For example, if you programmatically alter the speed setting of a device, you should return the terminal to its original setting when your program terminates unless you want the new speed setting to be in effect for other files opened against the same device.

When all files have been closed on a device (referred to as device close), and the device is no longer under the control of a program or a session, all device characteristics are returned to those specified by the device's configuration.

NOTE: If a disconnected status is received from a terminal your application has programmatically opened, your application should either FCLOSE the terminal or terminate.

Parameters

filenum

16-bit signed integer by value (required)

The file number of the file to be closed.

disposition

16-bit signed integer by value (required)

This parameter has no meaning for terminals or serial printers and should be set to 0.

securitycode

16-bit signed integer by value (required)

This parameter has no meaning for terminals or serial printers and should be set to 0.

Condition Codes

CCE

Request granted.

CCG

Not returned by this intrinsic.

CCL

Request denied. The file was not closed because an incorrect filenum was specified. Any outstanding write I/Os that failed (such as buffered writes that are done in background) also cause the FCLOSE to fail.

Additional Discussion

See the discussion of closing files in Accessing Files Programmer's Guide.

Feedback to webmaster