HPlogo 900 Series HP 3000 Computer Systems: MPE/iX Intrinsics Reference Manual > Chapter 4 Command Definitions

HPFDUPLICATE

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

NM callable only.

Creates duplicate file descriptors for files opened for MULTI, SHARED, or EXCLUSIVE access.

Syntax

     I16                     I32    I32V   *

   filenum:=HPFDUPLICATE(source,status,target);

Functional Return

filenum

16-bit signed integer (assigned functional return)

Returns the actual file number used to duplicate the source file. This file number can be different than the file number requested in the target parameter. If an error occurs during the duplication process, a -1 value is returned.

Parameters

source

32-bit signed integer by value (required)

Specifies the file number to be duplicated. The file number must be a valid, open file.

status

32-bit signed integer by reference (optional)

Returns the status of the HPFDUPLICATE call. If an error occurs and this parameter was not specified, the functional return can be used to determine the success or failure of the call.

target

32-bit signed integer by reference (optional)

Specifies the file number to be duplicated in the source parameter. If the file number is already opened, the next highest available file number is used. The value passed must be within the legal range of file numbers. The default value for this parameter is zero (0).

Operation Notes

When a file descriptor is duplicated, the duplicate file descriptor shares the same data pointer as the original file descriptor in the same way that file descriptors share the same data pointer with MULTI access. This gives you the ability to perform operations on files that have not been previously available. Specifically, files that are opened for SHARED or EXCLUSIVE access can now have their data pointers shared among multiple file descriptors, at the discretion of the application that originally opens the file descriptor.

Related Information

Intrinsics

FOPEN, HPFOPEN

Commands

None

Manuals

None

Feedback to webmaster