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

FFILEINFO

» 

Technical documentation

Complete book in PDF
 

 » Table of Contents

 » Index

NM and CM callable.

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 4-6 “FFILEINFO Itemnum/Item Values”.)

item

type varies (optional)

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

Table 4-6 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 return FSERR391.

2U16

File options:

Returns file characteristics (refer to the foption 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 will return FSERR399

3U16

Access options:

Returns file access information (refer to the Faoption 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 half words.

  • 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 half words.

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

For standard fixed ASCII files with odd record sizes, the block size is computed as "(record size + 1)" X block factor. For even record sizes, it returns the block size from the gufd.

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 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 release 4.5 of MPE/iX.

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 half words
22I16Data block size; indicates half words
23I16Offset to data in blocks; indicates half words
24I16Offset of active record table for RIO files; indicates half words
25I16Size of active record table within the block; indicates half words
26CAVolume ID (tape label)
27CAVolume set ID (tape label)
28U16Expiration date (calendar format)
29I16File sequence number
30I16Reel number
31I16Sequence type
32U16Creation date (calendar 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.

40I32

Disk device status:

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

41I16Device type
42I16Device subtype
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
47I16

DRT number:

Always returns an 8.

48I16

Device 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.

52I32

Last modification time (CLOCK format)

Zero is returned as the modification time for root directories, accounts, and MPE groups created prior to release 4.5.

53U16

Last modification date (CALENDAR format)

Zero is returned as the modification time for root directories, accounts, and MPE groups created prior to release 4.5.

54U16

File creation date (CALENDAR format)

Zero is returned as the modification time for root directories, accounts, and MPE groups created prior to release 4.5.

55U16

Last access date (CALENDAR format)

Zero is returned as the modification time for root directories, accounts, and MPE groups created prior to release 4.5.

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@64

Virtual 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). Odd or even record sizes are returned as the block size from the gufd.
69U32Extent size (indicates bytes)
74@64

Virtual 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).)

75CA

Hardware 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)

77U32

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)

80CA

HFS syntax filename.

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.

         Format of the buffer on input:



         byte     #1   #2   #3   #4 | #1   ...   #N

                +----+----+----+----+----+ ... +----+

                |      maximum      |               |

                |     length = N    |               |

                +----+----+----+----+----+ ... +----+



         Format of the buffer on output:



         byte     #1   #2   #3   #4 | #1   ...   #L   ...   #N

                +----+----+----+----+----+ ... +----+ ... +----+

                |    length =       | /  |     | \0 |     |    |

                |    (L - 1)        |    |     |    |     |    |

                +----+----+----+----+----+ ... +----+ ... +----+
81U32The current number of hard links to the file.
82I32

Time of last file access in clock format. The bit assignments are:

Bits 0 to 7

hours

Bits 8 to 15

minutes

Bits 16 to 23

seconds

Bits 24 to 31

tenths of seconds

83I32Time of last file status change in clock format (See item 82 for a description of clock format).
84U16

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

85CA

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.

86I32

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.

87CA

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.

88I32

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.

89U32

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

Not Applicable

8

Compatability mode file

9

Directory

10-11

Not Applicable

12

Pipe

13

FIFO

14

Symbolic link

15

Device link

90U32

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

This item will return information based upon the record format that is logically assoicated with the specified file designator and will not necessarily be the same as the physical record structure of the file. It is possible with the HPFOPEN intrinsic item 77, Read Format option, to access a file in a different mode than the physical record type. For example, byte stream record files, when opened by default, present variable record instead of the physical byte stream storage, since the file was opened to behave like a variable record file. In order to determine the true physical record structure of a file, use the FFILEINFO item 101.

91I64

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.

92I32

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.

93U32

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.

94I32

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

95I32

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.

96I32

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).

97I32

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.

98I32

Carriage Control

This item returns a value indicating whether or not the carriage control option is in effect for this file. If carriage control is on, a value of 1 is returned. Otherwise, a value of 0 is returned.

99I32

Setuid Flag

This item returns a value indicating whether or not this file has the setuid flag turned on. When the setuid flag is on for a program file, the program will execute under the user who owns the file rather than under the user who invoked the program. A value of 1 indicates that the setuid flag is on; a value of 0 indicates the flag is off.

100I32

Setgid Flag

This item returns a value indicating whether or not the file has the setgid flag turned on. When the setgid flag is on for a program file, the program will execute with the GID membership of the file rather than the GID membership of the process that invoked the program. A value of 1 indicates that the setgid flag is on; a value of 0 indicates that the flag is off.

101I32

Physical record type

This item returns the record type of the file's physical record layout. It is possible through the HPFOPEN option 77, Read Format option, to emulate a different record structure than the actual physical record structure of the file. To get the current logical record view, use FFILEINFO item 90.

The following values will be returned by this item:

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

102I32

Dissallow file equation flag

This item returns a value indicating whether or not file equations were disallowed when the file was opened. A value of zero indicates that file equations were allowed; a value of 1 indicates file equations were disallowed. This item is identical to bit 5:1 of the foptions.

103I32

MPE Tape labels flag

This item returns a value indicating whether or not a tape was opened labeled or unlabeled. A value of 0 indicates an unlabeled tape; a value of 1 indicates a labeled tape. This item is identical to bit 6:1 of the foptions.

104I32

File designator type

This item returns the file designator type for this file. It is identical to bit 10:3 of the foptions. The following values can be returned by this item:

0

A normal file open

1

$STDLIST

2

$NEWPASS

3

$OLDPASS

4

$STDIN

5

$STDINX

6

$NULL

7

$STDERR

105I32

ASCII/Binary flag

This item returns the setting of the file's ASCII/Binary flag. A value of 0 indicates that this is a binary file; a value of 1 indicates that this is an ASCII file. This item is identical to bit 13:1 of the foptions.

106I32

File domain

This item returns the domain in which the file currently resides. It is identical to bit 14:2 of the foptions, and can return the following values:

0

New file domain

1

Permanent file domain

2

Temporary file domain

 

Table 4-7 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
1090LOGUser 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
1168MARPAARPA 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
1236BMAPBase 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 4-3 Foption Bit Summary

[Foption Bit Summary]

Figure 4-4 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.

Related Information

Intrinsics

None

Commands

None

Manuals

Getting System Information Programmer's Guide (32650-90018)