HPlogo MPE/iX Intrinsics Reference Manual > Chapter 5 Command Definitions (FCONTROL - FLOCK)

FGETINFO

MPE documents

Complete PDF
Table of Contents
Index

Edition 7 E0701 ♥
Edition 7 E0300
Edition 6 E0195

NM and CM callable.

Returns access and status information about a file.


NOTE: FGETINFO is provided for compatibility with MPE V/E-based systems only. It is recommended that FFILEINFO be used to access data.

Syntax



            I16V     CA           U16      U16
  FGETINFO (filenum, formaldesig, foption, aoption
            I16       I16      U16      U16     I16
            lrecsize, devtype, ldevnum, hdaddr, filecode,
            I32      I32  I32        I32       I32        I16
            lrecptr, eof, filelimit, logcount, physcount, blksize,
            U16      I16        I16         CA         I32
            extsize, numextent, userlabels, creatorid, labaddr);

Parameters


filenum

16-bit signed integer by value (required)

Passes the file number of the file for which information is requested.

formaldesig

character array (optional)

Returns the actual designator of the file being referenced, in the following format:


  filename.groupname.accountname

The formaldesig array must be at least 28 bytes in length. When the actual designator is returned, unused bytes in the array are filled with blanks on the right. A nameless file returns an empty string.

The fully qualified name of the file referenced by filenum is returned as the value of this parameter. Only names which can be expressed using MPE-only semantics are returned. If the name of the object referenced by filenum can not be expressed using MPE-name semantics, a CCL condition code is returned. Calling FCHECK after this error will return FSERR391.

foption

16-bit unsigned integer by reference (optional)

Returns seven file access characteristics by setting bit groupings as follows:

BitsValue/Meaning
14:2Domain:

The file domain searched to locate the file:

00New file
01Old permanent file
10Old temporary file
11Old temporary or permanent file

The record format extension bit is returned as the foption (1:1) bit. Byte stream record format is represented as a record format extension of one with a variable record format (foption (8:2) bits equal to 01.

Directories, symbolic links, device links, pipes and FIFO's cannot be represented by foptions. If the object referenced by filenum is one of these types, an error will be returned. Use FFILEINFO items 102 through 106 to get this information.

(ASC) Not valid for asynchronous device files; however, these bits may have been set if file redirection was anticipated.
 
13:2ASCII/Binary:

0Binary
1ASCII
 
10:3Default file designator:

000Actual file designator (same as formal file designator)
001Actual file designator $STDLIST
010Actual file designator $NEWPASS
011Actual file designator $OLDPASS
100Actual file designator $STDIN
101Actual file designator $STDINX
110Actual file designator $NULL
 
8:2Record format:

00Fixed-length records
01Variable-length records
10Undefined-length records
11Spoolfile format records

(ASC) Not valid for asynchronous device files; however, "fixed-length" may have been set if file redirection was anticipated.
 
7:1Carriage control:

0No carriage-control character expected
1Carriage-control character expected
 
6:1MPE/iX tape label:

0Nonlabeled tape
1Labeled tape

(ASC) Not valid for asynchronous device files. May have been set if file redirection was anticipated.
 
5:1Disallow FILE equation:

This option ignores any corresponding FILE command, so the specifications in the call to FOPEN/HPFOPEN take effect (unless overridden by those in the file label). The following bit settings apply:

1Disallow FILE command
0Allow FILE command
 
2:3File type:

000Standard file (STD)
001KSAM/3000 file
010Relative I/O file (RIO)
011KSAM XL file
100Circular file (CIR)
101NM spoolfile
110Message file (MSG)

(ASC) Set to 000 for asynchronous device files.
 
1:1Record format extension:

0Do not use extended record format
1Use extended record format
 
0:1Reserved for the operating system

aoption

16-bit unsigned integer by reference (optional)

Returns file access information by setting bit groupings in the following manner:

BitsValue/Meaning
12:4Access type:

The type of access allowed users of this file:

0000Read only
0001Write only
0010Write only (previous data not deleted)
0011Append only
0100Read/Write
0101Update
0110Execute
0111Execute-Read
1000Reserved
1001Directory read access
 
11:1Multirecord:

0Nonmultirecord mode
1Multirecord mode
 
10:1Dynamic locking:

0Disallow dynamic locking/unlocking
1Allow dynamic locking/unlocking
 
8:2Exclusive:

Specifies the access, from the time it is opened to the time it is closed:

00Default
01Exclusive access
10Semi-Exclusive access
11Shared access
 
7:1Inhibit buffering:

Inhibits automatic buffering by the operataing system and allows I/O to take place directly between the stack and the applicable hardware device:

0Normal buffering
1Inhibit buffering

(ASC) Not valid for asynchronous device files.
 
5:2Multiaccess mode:

Provides the accessors with shared access to the file:

00Nonmultiaccess
01Intrajob multiaccess
10Interjob multiaccess

(ASC) Not valid for asynchronous device files.
 
4:1Nowait I/O:

Allows the accessors to initiate an I/O request and to have control returned before completion of the I/O.

0Nowait I/O not in effect
1Nowait I/O in effect
 
3:1File copy access:

0Access in file's native mode
1Access as standard sequential file
 
0:3Reserved for the operating system.

lrecsize

16-bit signed integer by reference (optional)

Returns the logical record size associated with the file:

  • If the file was created as a binary file, this value is positive and expresses the size in half words.

  • If the file was created as an ASCII file, this value is negative and expresses the size in bytes.

For interprocess communication (IPC), when there is a call to FCONTROL with controlcode=46, the value returned in lrecsize is the size of the data records, including the 4-byte header.

Maintained to ensure backward compatibility with MPE V/E-based systems. MPE V/E record size limits are imposed when FGETINFO returns record size information on all file types (STD, KSAM, RIO, CIR, MSG). If the record size of the specified file exceeds MPE V/E limits, a zero is returned. Use itemnum 67 of the FFILEINFO intrinsic or itemnum 30 of the FLABELINFO intrinsic to obtain valid MPE/iX record size data if the record size exceeds MPE V/E limits.

devtype

16-bit signed integer by reference (optional)

Returns the type and subtype of the device being used for a KSAM, RIO, circular, or message file, or devices such as a tape drive, printer, or terminal where bits (0:8) indicate device subtype, and bits (8:8) indicate device type. For standard disk files, bits (8:8)=00000011 and bits (0:8)=00001000 (indicate a 7933/35 disk drive).

If the file is not spooled or is opened as a spoolfile through the logical device, the returned devtype is actual. If an output file is spooled and was opened by device class name, devtype contains the type and subtype of the first device in its class. (This may be different from the device actually used.)

ldevnum

16-bit unsigned integer by reference (optional)

Returns the logical device number (ldev) associated with the device where the file label resides:

  • If the file is a disk file, ldevnum is the location of the file label. (File data may reside on the same device as the file label.)

  • If the file is spooled, ldevnum is a virtual device number that does not correspond to the system configuration I/O device list.

  • If the file is located on a remote computer, linked by a DS point-to-point or X.25 link, the left eight bits (0:8) are the logical device number of the distributed system (DS) device.

  • If the remote computer is linked by NS 3000/XL, the left eight bits (0:8) are the remote environment of the connection. The right eight bits (8:8) are the LDEV of the device on the remote computer where the file label resides.

  • If the DS device for the RFA or the LDEV is 0, then ldevnum returns a 0.

hdaddr

16-bit unsigned integer by reference (optional)

Returns 2048. Maintained to provide backward compatibility with MPE V/E-based systems.

filecode

16-bit signed integer by reference (optional)

Returns the file code of a disk file.

(ASC) Not valid for asynchronous device files.

lrecptr

32-bit signed integer by reference (optional)

Returns the current logical record pointer setting. This value is the displacement in logical records from record number 0 in the file and identifies the record that would be accessed next by an FREAD or FWRITE call.

(ASC) Not valid for asynchronous device files.

eof

32-bit signed integer by reference (optional)

Returns the pointer setting of the last logical record currently in the file (equivalent to the number of logical records currently in the file). If the file does not reside on disk, this value is zero. For interprocess communication (IPC), when a call to FCONTROL with itemnum=46 is in effect, the number of records returned in eof includes open, close, and data ecords.

(ASC) Not valid for asynchronous device files.

filelimit

32-bit signed integer by reference (optional)

Returns a number representing the last logical record that could exist in the file (the physical limits of the file). If the file does not reside on disk, this value is zero.

(ASC) Not valid for asynchronous device files.

logcount

32-bit signed integer by reference (optional)

Returns the total number of logical records passed to and from the program during the current file access.

physcount

32-bit signed integer by reference (optional)

Returns the total number of physical I/O operations performed within the process, against the file, since the last FOPEN/HPFOPEN call.

blksize

16-bit signed integer by reference (optional)

Returns the file block size:

  • If the file is binary, the value is positive and the size is in half words.

  • If the file is ASCII, the value is negative and the size is in bytes.

Maintained for backward compatibility with MPE V/E-based systems. MPE V/E block size limits are imposed when FGETINFO returns block size information on all file types (STD, KSAM, RIO, CIR, MSG). If the block size of the specified file exceeds MPE V/E limits, 0 is returned. Use itemnum=68 of the FFILEINFO intrinsic or itemnum=31 of the FLABELINFO intrinsic to get valid MPE/iX block size data if the block size exceeds MPE V/E limits.

(ASC) Not valid for asynchronous device files.

extsize

16-bit unsigned integer by reference (optional)

Maintained to provide backward compatibility with MPE V/E-based systems.

(ASC) Not valid for asynchronous device files.

numextent

16-bit signed integer by reference (optional)

Maintained to provide backward compatibility with MPE V/E-based systems.

(ASC) Not valid for asynchronous device files.

userlabels

16-bit signed integer by reference (optional)

Returns the number of user labels defined for the file during creation. If the file is not a disk file, this number is zero. When an old file is opened for overwrite output, the value of userlabels is not reset, and old user labels are not destroyed.

(ASC) Not valid for asynchronous device files.

creatorid

character array (optional)

An unqualified form of the file owner's name is returned as the value of this parameter. The file owner is not necessarily the file's creator. File ownership may be changed using the :ALTFILE command.

A symbolic zero (ASCII 48 in decimal) is returned as the file owner for root directories, accounts, and MPE groups created prior to the POSIX release.

If the file is not located in the account in which the file owner is a member, a blank file owner name is returned.

(ASC) Not valid for asynchronous device files.

labaddr

32-bit signed integer by reference (optional)

Returns a zero. Maintained for backward compatibility with MPE V/E-based systems.

(ASC) Not valid for asynchronous device files.

Operation Notes


Returns access and status information about a file located on any device. The file must be opened by the calling process at the time of the FGETINFO call.

Condition Codes


CCE (2)Request granted.
CCG (0)Not returned.
CCL (1)Request denied. An error occurred.

Related Information


Intrinsics FFILEINFO, FGETKEYINFO, FLABELINFO, FRELATE
Manuals Accessing Files Programmer's Guide
Using KSAM XL
KSAM/3000 Reference Manual




FFINDN


FGETKEYINFO