HPlogo Using KSAM XL: 900 Series HP 3000 Computer Systems > Chapter 9 KSAM XL Intrinsics

FFILEINFO

» 

Technical documentation

Complete book in PDF
 

 » Table of Contents

 » Index

Returns information about a file.

Syntax


             I16V       I16V   *

   FFILEINFO(filenum[,itemnum,item] [...]);

NOTE: Up to five itemnum/item pairs can be specified.

Parameters

filenum

16-bit signed integer by value (required)

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

itemnum

16-bit signed integer by value (optional)

Specifies which item value is to be returned. (Refer to Table 9-2 “FFILEINFO Itemnum/Item Values”.)

item

type varies (optional)

Returns the value of the item specified in the corresponding itemnum. (Refer to Table 9-2 “FFILEINFO Itemnum/Item Values”.)

Table 9-2 FFILEINFO Itemnum/Item Values

ItemnumItem TypeItem Description
1CA

File designator (28 bytes): Returns the file designator of the file being referenced in the format:

filename.groupname.accountname

Must be >=28 bytes in length. Unused bytes are filled with right-justified blanks and a nameless file returns an empty string.

The fully qualified name of the file referenced by filenum is returned as the value of this itemnum. Only names which can be expressed using MPE-only semantics are returned by this itemnum. 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 for filenum after this error occurs will result in error.

2U16

File options: Returns file characteristics (refer to the FFfoption figure).

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 can not be represented by foptions. If the object referenced by filenum is one of these objects, a CCL condition code is returned. Calling FCHECK for filenum after this error occurs will result in error.

3U16

Access options: Returns file access information (refer to the FFaoption figure).

4I16

(CM) Record size: Returns the logical record size associated with the file:

  • If the file was created as a binary file, this value is positive and is in halfwords.

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

For message files, when there is call to FCONTROL with controlcode=46, the value returned is the size of the data records, including the 4 byte header.

Maintained for compatibility with MPE V/E-based systems only. CM record sizes are imposed when FGETINFO returns record size information on all file types. If the record size exceeds the limits, a zero is returned.

NOTE: If a zero is returned, use item 67.
5I16

Device type/subtype: 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 the device subtype, and bits (8:8) indicate the device type.

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

6U16

Logical device number: Returns the logical device number of the device where the disk file label resides.

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

  • If the file is spooled, the LDEV 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 LDEV of the distributed system (DS) device.

  • If the file is located on a remote computer, 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 a zero is returned.

NOTE: If a zero is returned, use item 50.
7U16

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

8I16

File code: Returns the file code of a disk file (refer to FFILEINFO for file codes).

9I32

Current logical record pointer: 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 FREAD or FWRITE.

10I32

EOF: Returns the pointer setting of the last logical record currently in the file (equivalent to EOF). If the file does not reside on disk, the value is zero. For message files, when a call is made to FCONTROL with itemnum=46, the number of records returned includes open, close, and data records.

11I32

File limit: Returns a number representing the last logical record that can exist in the file (equivalent to the file limit). If the file does not reside on disk, the value is zero.

12I32

Log count: Returns the logical records passed to and from the program during the current file access.

13I32

Physical count: Returns the number of buffered physical I/O operations performed since the last FOPEN/HPFOPEN call (records).

14I16

Block size: Returns the file block size:

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

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

Maintained for compatibility with MPE V/E-based systems only. CM block size limits are used when FGETINFO returns block size information on all file types (STD, KSAM, RIO, CIR, MSG). If the block size of the specified file exceeds the limits, zero is returned.

NOTE: If a zero is returned, use item 68.
15I16

Extent size: Returns the extent size; for compatibility with MPE V/E-based systems only.

NOTE: If a zero is returned, use item 69. If extent size is specified or the maximum number of extents is specified at file creation, the size and number of extents are determined by the operating system and the item values are not actual values; they are calculated using system defaults.
16U16

Maximum number of extents:

If the extent size or maximum number of extents is specified as zero at file creation, then the size and number of extents are determined by the system. In that case, these item values are calculated using system defaults defaults and do not reflect actual values.

17I16

User labels: 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 is not reset and the old user label is not destroyed.

18CA

Creator: Returns the name of the file creator (at least 8 bytes). If the file does not reside on disk, blanks are returned.

An unqualified form of the file owner's name is returned as the value of this itemnum. The file owner is not neccessarily the file's creator. File ownership may be changed using (see engineer).

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. Item number 85 should be used to obtain the full file owner name instead of item 18.

19I32

Label address: Returns a zero. For compatibility with MPE V/E-based systems only.

20I16Blocking factor
21I16Physical block size; indicates halfwords
22I16Data block size; indicates halfwords
23I16Offset to data in blocks; indicates halfwords
24I16Offset of active record table for RIO files; indicates halfwords
25I16Size of active record table within the block; indicates halfwords
26CAVolume ID (tape label)
27CAVolume set ID (tape label)
28U16Expiration date (julian format)
29I16File sequence number
30I16Reel number
31I16Sequence type
32U16Creation date (julian format)
33I16Label type
34I16Current number of writers
35I16Current number of readers
36U16File allocation date, when the file was last restored (CALENDAR format)
37I32File allocation time, when the file was last restored (CLOCK format)
38U16

Spoolfile device file number:

  • Bits (1:15) = Device file number

  • Bit (0:1) = 1 Output spoolfile

  • Bit (0:1) = 0 Input spoolfile

If the spoolfile device number is larger than 32767, itemnum 38 returns 0 (zero). Use itemnum 78 instead for spoolfile numbers larger than 32767.

40I32Disk device status: Returns a zero. For compatibility with MPE V/E-based systems only.
41I16Device type
42I16Device subtype: Always returns an 8. (Indicates a 7933 or 7935 disk drive)
43CAEnvironment file name (>=36 bytes)
44I16Number of disk extents currently allocated to the file
45CAFile name from labeled tape header 1 record (>= 17 bytes)
46I16Tape density
47I16DRT number: Always returns an 8.
48I16Device unit number: Always returns a 0.
49U16Equivalent to a software interrupt PLABEL for message files
50U16Real device number of the file
51I16

Remote environment number

Note: If using NS 3000/XL RFA (remote file access), specify DSDEVICE ldev# when you are using a DS (point-to-point or X.25) link.

52I32Last modification time (CLOCK format) Zero is returned as the modification time for root directories, accounts, and MPE groups created prior to the POSIX release.
53U16Last modification date (CALENDAR format) Zero is returned as the modification time for root directories, accounts, and MPE groups created prior to the POSIX release.
54U16File creation date (CALENDAR format) Zero is returned as the modification time for root directories, accounts, and MPE groups created prior to the POSIX release.
55U16Last access date (CALENDAR format) Zero is returned as the modification time for root directories, accounts, and MPE groups created prior to the POSIX release.
56I32Number of data blocks in a variable length file
57I16Number of user labels written to the file
58I16Number of accessors having output access (write) for a particular file
59I16Number of accessors having input access (read/update) for a particular file
60I16

Terminal type:

0

File's associated device not a terminal

1

Standard hardwire or multipoint terminal

2

Terminal connected through phone-modem

3

DS pseudo-terminal

4

X.25 Packed Switching Network PAD (packet assembler/disassembler) terminal

5

NS virtual terminal

61CA

NS 3000/XL remote environment ID name

Note: If using NS 3000/XL RFA (remote file access), specify DSDEVICE ldev# when using a DS (point-to-point or X.25) link. A buffer must be provided for the node name (or envid) with the required space of 52 bytes; otherwise, data corruption may occur on variables following itemnum=61 or an FSERR 73, BOUNDS VIOLATION may be returned.

62CAFile lockword (8 bytes):
63CAUnique file identifier (UFID) (20 bytes):
64@64Virtual address of the file: Applicable for standard disk files only. (Requesting itemnums 64, 74, or 75 for any other file type, RIO, MSG, CIR, causes an error and returns CCL (1).)
65 Reserved for the operating system.
66@32Virtual address of global unique file descriptor (GUFD):
67U32(NM) Record size (indicates bytes)
68U32Block size (indicates bytes)
69U32Extent size (indicates bytes)
74@64Virtual address of file label: Applicable for standard disk files only. (Requesting itemnums 64, 74, or 75 for any other file type (RIO, MSG, CIR) causes an error and returns CCL (1).)
75CAHardware path: Applicable for standard disk files only. (Requesting itemnums 64, 74, or 75 for any other file type (RIO, MSG, CIR) causes an error and returns CCL (1).)
76CA

Volume restriction (34 bytes): The last two characters indicate the type:

0

File placed on the specified volume at creation

1

File can be placed on any volume containing the specified class at creation

2

File can be placed on any volume within the specified volume set at creation (Default)

77 U32 Transaction management log set ID If itemnum 77 = 0 (zero), the file is not attached to the XM (Transaction Management) log.
78U32

Spoolfile device file number:

  • Bits (1:31) = Device file number

  • Bit (0:1) = 1 Output spoolfile

  • Bit (0:1) = 0 Input spoolfile

79I16

File's pending disposition

  • 0 = No change, the disposition is the same as before the file was opened

  • 1 = Permanent

  • 2 = Temporary (tape files rewound)

  • 3 = Temporary (same as 2 except tape files not rewound)

  • 4 = Released (purged)

  • 5 = Temporary (but the file was previously a permanent file)

80 

This itemnum returns a null-terminated POSIX-syntax system absolute pathname for the file or directory referenced by filenum. On input the first four bytes of this buffer are interpreted as a 32-bit unsigned integer specifying the maximum buffer size in bytes. This maximum buffer size does not include the four bytes used to represent this size. On output the first four bytes of the buffer represent the pathname length excluding the null-terminator as an unsigned integer. The pathname is returned in the bytes following the pathname length. Bytes beyond the null-terminator should be considered undefined. If the maximum buffer length is incorrect on input, variables allocated near the buffer may be overwritten or a bounds violation may occur. A zero pathname length is returned for unnamed new files and when an error occurs. Zero is the mininum buffer length on input for this itemnum.

(add drawing of Format of the buffer on input)

81 32-bit unsigned integer by reference. The current number of hard links to the file.
82 

32-bit signed integer by reference. Time of last file access in clock format. The bit assignments are:

Bits 0

7 hours

Bits 8

15 minutes

Bits 16

23 seconds

Bits 24

31 tenths of seconds

83 32-bit signed integer by reference. Time of last file status change. (Clock format - See item 82 for a description of the format).
84 

16-bit unsigned integer by reference. Date of last file status change in calendar format. The bit assignements are:

Bits 0 - 7

Year of the century

Bits 8 - 15

Day of the year

85 

32-byte character array by reference. File Owner:

The full file owner name. Unused characters are blank filled. 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.

86 

32-bit signed integer by reference. File owner identifier:

The file owner identifier (UID). Zero is returned as the file owner ID for root directories, accounts, and MPE groups created prior to the POSIX release.

87 

32-byte character array by reference. File group:

The file group name. Unused characters are blank filled. A symbolic zero (ASCII 48 in decimal) is returned as the file group for root directories whose GID's have not been assigned.

88 

32-bit signed integer by reference. File group identifier:

The file group identifier (GID). Zero is returned as the file group ID for root directories whose GID's have not been assigned.

89 

32-bit unsigned integer by reference. File type:

The following valid file types may be returned:

0

Ordinary File

1

KSAM/3000

2

RIO

3

KSAM XL

4

CIR

5

Native Mode Spool File

6

MSG

7-8

Not Applicable

9

Directory

10-11

Not Applicable

12

Pipe

13

FIFO

14

Symbolic link

15

Device link

90 

32-bit unsigned integer by reference. Record type:

The following valid record types may be returned:

0

Fixed

1

Variable

2

Undefined

3

Spool block

4

Root directory

5

Not applicable

6

Account directory

7

Group directory

8

Not applicable

9

Byte stream

10

Hierarchical directory

91 

64-bit signed integer by reference. The current file size in bytes. The value returned represents the current position of the End-of-File (EOF) and may not reflect the number of bytes actually occupied by the file on disk if the file is sparsely allocated.

92 

32-bit signed integer by reference. KSAM XL file version:

This item returns a value indicating the version of a KSAM XL file. A value of 1 indicates an original type KSAM XL file, and a value of 2 indicates the next generation KSAM XL file. A value of zero is returned if the file is not a KSAM XL file.

93 

32-bit unsigned integer by reference. NM Plabel:

This item returns a 32-bit NM Plabel of a message file interrupt handler. Interrupts may be enabled on message files by calling the FCONTROL intrinsic with item 48 and the Plabel address.

94 

32-bit signed integer by reference. MPE/iX device type:

This item returns the following values for the following types of devices:

0

Disk device

1

Tape device

2

Terminal device

3

Printer device

4

Remote device

5

Ports device

6

Reserved

7

Streams device

8

Sockets device

95 

32-bit signed integer by reference. Close-on-Exec:

This item returns a value indication whether or not this filenum is closed if one the POSIX.1 exec() family of functions if called. A value of 1 means that the file is closed on an exec() call, while a value of 0 indicates the file will survive across exec() calls.

96 

32-bit signed integer by reference. POSIX Append mode:

This item returns a value indicating whether or not this filenum has the POSIX.1 append mode flag set. When the append mode flag is set on files that support this feature, all writes occur at the end of the file, although reads may occur anywhere in the file. A value of 1 indicates that the POSIX.1 append mode is on, while a value of 0 indicates the append mode is off.

The only time that the POSIX.1 append mode is valid is when a file has been oepned for byte stream access (HPFOPEN option 77 with a value of 2).

97 

32-bit signed integer by reference. POSIX non-block mode:

This item returns a value indicating whether or not this filenum has the POSIX.1 non-block flag set. When the non-block flag is set, on files that support this feature, reads, writes, and opens can be affected in a file dependent manner. In general, operations that would otherwise have impeded the caller results in immediate return when this flag is set. A value of 1 indicates the non-block flag is set, while a value of zero indicates the flag is not set.

The only time the non-block flag is valid is for pipes and FIFO's.

 

Table 9-3 FFILEINFO File Codes

IntegerMnemonicDescription
0 Default (unreserved)
1024USLUser subprogram library
1025BASDBasic data
1026BASPBasic program
1027BASFPBasic fast program
1028RLCompatibility mode relocatable library
1029PROGCompatibility mode program file
1030NMPRGNative mode program file
1031SLSegmented library
1032NMSLNative mode executable library
1033NMRLNative mode relocatable library
1035VFORMVPLUS forms file
1036VFASTVPLUS fast forms file
1037VREFVPLUS reformat file
1040XLSAVCross loader ASCII file (SAVE)
1041XLBINCross loader relocated binary file
1042XLDSPCross loader ASCII file (DISPLAY)
1050EDITQEdit quick file
1051EDTCQEdit KEEPQ file (COBOL)
1052EDTCTEdit TEXT file (COBOL)
1054TDPDTTDP diary file
1055TDPQMTDP proof marked QMARKED
1056TDPPTDP proof marked non-COBOL file
1057TDPCPTDP proof marked COBOL file
1058TDPQTDP work file
1059TDPXQTDP work file (COBOL)
1060RJEPNRJE punch file
1070QPROCQUERY procedure file
1080KSAMKKSAM key file
1083GRAPHGRAPH specification file
1084SDSelf-describing file
1090 LOGUser logging log file
1100WDOCHewlett-Packard WORD document
1101WDICTHewlett-Packard WORD hyphenation dictionary
1102WCONFHewlett-Packard WORD configuration file
1103W2601Hewlett-Packard WORD attended printer environment
1110PCELLIFS 3000/XL character cell file
1111PFORMIFS 3000/XL form file
1112PENVIFS 3000/XL environment file
1113PCCMPIFS 3000/XL compiled character cell file
1114RASTRGraphics image in RASTR format
1130OPTLFOPT/3000 log file
1131TEPESTEPE/3000 script file
1132TEPELTEPE/3000 log file
1133SAMPLAPS/3000 log file
1139MPEDLMPEDCP/DRP log file
1140TSRHewlett-Packard Toolset root file
1141TSDHewlett-Packard Toolset data file
1145DRAWDrawing file for Hewlett-Packard DRAW
1146FIGFigure file for Hewlett-Packard DRAW
1147FONTReserved
1148COLORReserved
1149D48Reserved
1152SLATECompressed SLATE file
1153SLATWExpanded SLATE work file
1156DSTORRAPID/3000 DICTDBU utility store file
1157TCODECode file for TRANSACT/XL compiler
1158RCODECode file for Report/3000 compiler
1159ICODECode file for Inform/3000 compiler
1166MDISTHewlett-Packard Desk distribution list
1167MTEXTHewlett-Packard Desk text
1168 MARPAARPA messages file
1169MARPDARPA distribution list
1170MCMNDHewlett-Packard Desk abbreviated commands file
1171MFRTMHewlett-Packard Desk diary free time list
1172NoneReserved
1173MEFTHewlett-Packard Desk external file transfer messages file
1174MCRPTHewlett-Packard Desk encrypted item
1175MSERLHewlett-Packard Desk serialized (composite) item
1176VCSFReserved
1177TTYPETerminal type file
1178TVFCTerminal vertical format control file
1192NCONFNetwork configuration file
1193NTRACNetwork trace file
1194NLOGNetwork log file
1195MIDASReserved
1211ANODEReserved
1212INODEReserved
1213INVRTReserved
1214EXCEPReserved
1215TAXONReserved
1216QUERFReserved
1217DOCDRReserved
1226VCVC file
1227DIFDIF file
1228LANGDLanguage definition file
1229CHARDCharacter set definition file
1230MGCATFormatted application file
1236 BMAPBase map specification file
1242BDATABASIC data file
1243BFORMBASIC field order file for VPLUS
1244BSAVEBASIC saved program file
1245BCNFGConfiguration file for default option BASIC program
1258PFSTAPathflow static file
1259PFDYNPathflow dynamic file
1270RFDCARevisable form DCA data stream
1271FFDCAFinal form DCA data stream
1272DIUDocument interchange unit file
1273PDOCHewlett-Packard WORD/150 document
1401CWPTXReserved
1421MAPHewlett-Packard MAP/3000 map specification file
1422GALReserved
1425TTXReserved
1461NMOBJNative mode object file
1462PASLBPascal/XL source library

 

Figure 9-1 Foption Bit Summary

[Foption Bit Summary]

Figure 9-2 Aoption Bit Summary

[Aoption Bit Summary]

Condition Codes

CCE (2)

Request granted.

CCG (0)

Not returned.

CCL (1)

Request denied. Access or calling sequence error.

Refer to this intrinsic in the MPE/iX Intrinsics Reference Manual (32650-90028) for other codes pertaining to KSAM files.