HPlogo Using KSAM XL and KSAM 64 > Chapter 9 KSAM Intrinsics

FLABELINFO

MPE documents

Complete PDF
Table of Contents
Index

E0300 Edition 4 ♥
E0394 Edition 3

Syntax Parameters Operation Notes Condition Codes

Returns information from the file label of a disk file.

Syntax



              CA           I16V  I16
  FLABELINFO (formaldesig, mode, fserrorcode,
    I16A     REC   I16A
    itemnum, item, itemerror);

Parameters


formaldesig

character array (required)

Passes the name of the file using either MPE syntax (the default) or HFS syntax. The file name must be terminated by a nonalphanumeric character other than a period (.), a slash (/), a hyphen (-), and an underscore (_).

If MPE syntax, the file name can include password, group, and account specifications. The file name can backreference a file equation and optionally be preceded by an asterisk.

If HFS syntax, the file name must start with either a dot (.) or a slash (/). For files located in HFS directories, traverse directory entries (TD) access is required to all directories specified in formaldesig. If there is no TD access, FLABELINFO fails and a file system error code (398) is returned in the fserrorcode parameter.

If the file can be named using both MPE syntax and HFS syntax (for example, FILEA.MYGROUP.MYACCT and /MYACCT/MYGROUP/FILEA), the file can be either permanent or temporary. If a temporary and a permanent file have the same name, FLABELINFO returns information about the temporary file only.

mode

16-bit signed integer by value (required)

Passes an option specifying the valid backreferencing to file equations for the file. Valid values are:

Bits

Value/Meaning

0:11

Reserved for future use.

11:1

Symbolic Link Traversal

0

To traverse through symbolic links, if they exist.

1

Do not traversing through symbolic links, if they exist.

12:2

Caller Privilege Level

Allows the caller to pretend to be less privileged. The privilege level is passed in this field.

14:2

File Equations

0

Use file equation (if one exists)

1

Must use file equation (error if one does not exist)

2

Ignore existing file equations

fserrorcode

16-bit signed integer by reference (required)

Returns a value indicating whether an error or warning occurred when FLABELINFO attempted to return requested information:

  • A value of zero indicates that no errors were encountered.

  • A positive value is a file system error code and indicates that an error was encountered and no information was returned in item.

  • A -1 indicates that an item error or warning has occurred. Check the itemerror parameter to determine which item(s) has an error/warning and what it is.

itemnum

16-bit signed integer array (required)

Specifies which item value is to be returned. (Refer to Table 9-5 "FLABELINFO Itemnum/Item Values")

To indicate the end of the list, place a zero in the element following the last itemnum.

item

record (required)

Returns the value of the item specified in the corresponding itemnum.(Refer to Table 9-5 "FLABELINFO Itemnum/Item Values")

Itemnum/items are paired such that the nth field of the item record corresponds to the nth element of the itemnum array.

itemerror

16-bit signed integer array (required)

Returns an error number corresponding to the items specified in the itemnum array. The itemnum/item and itemerror parameters are paired such that the nth element of the itemerror array corresponds to the nth element of the itemnum array.

If a value in the itemerror array is negative, a warning exists for the corresponding item. If the value is positive, an error was detected for the corresponding item. The absolute value of each value is a file system error number.

Table 9-5 FLABELINFO Itemnum/Item Values

Itemnum Mnemonic Item Description
1CAFile name (8 bytes): The file name component for the file referenced in formaldesig is returned as the value. If the file name is not expressible using MPE-only semantics, a file system error code (391) is returned in the associated itemerror.
2CAGroup name (8 bytes): The group name component for the file referenced in formaldesig is returned as the value. If the group name is not expressible using MPE-only semantics, a file system error code (391) is returned in the associated itemerror.
3CAAccount name (8 bytes): The account name component for the file referenced in formaldesig is returned as the value. If the account name is not expressible using MPE-only semantics, a file system error code (391) is returned in the associated itemerror.
4CA

File creator name (8 bytes): An unqualified form of the file owner's name is returned as the value. The file owner is not necessarily the file's creator.

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

If the file is not located in the account where the file owner is a member, a blank file owner name is returned. Use itemnum=43 to obtain the full file owner name.

5U32Security matrix for access: Returns the file's security matrix. This value does not indicate the actual security enforced for a file, since group and account security masks can also restrict access. This field is ignored if an ACD is active on a file.
6U16File creation date: The date in CALENDAR intrinsic format. Either creator (C) or manager (AM if file is within account, otherwise SM) access required.

Zero is returned as the creation date for root directories, MPE accounts, and MPE groups created prior to release 4.5.
7U16Last access date: The date in CALENDAR intrinsic format. May not be up-to-date when the file is open.

Zero is returned as the last access date for root directories, MPE accounts, and MPE groups created prior to release 4.5.
8U16Last modification date: The date in CALENDAR intrinsic format. May not be up-to-date when the file is open.

Zero is returned as the modification date for root directories, MPE accounts, and MPE groups created prior to release 4.5.
9I16File code of disk file
10U16Number of user labels written: May not be up-to-date when the file is open.
11U16Number of user labels available: May not be up-to-date when the file is open.
12I32Total number of logical records possible in the file: Equivalent to the file limit measured in logical records.
13U16File options: 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 foption. If the object referenced by filenum is is an object, MPE error 399 is returned in the associated itemerror.

Refer to the foption figure.
14I16Record size: Maintained for compatibility with MPE V/E-based systems. (If a zero is returned, use itemnum 30 instead.)
15I16Block size: Maintained for compatibility with MPE V/E-based systems. (If a zero is returned, use itemnum 31 instead.)
16I16Maximum number of extents: Maintained for compatibility with MPE V/E-based systems. (If a zero is returned, use itemnum 32 instead.)
17I16Last extent size: Indicates sectors. May not be up-to-date when the file is open.
18I16Extent size: Indicates sectors. (If a zero is returned, use itemnum 32 instead.)
19U32Number of logical records in file: Equivalent to EOF. May not be up-to-date when the file is open.
20U32File allocation time: The time when file was last restored (in CLOCK intrinsic format).

Zero is returned as the file allocation time for root directories, MPE accounts, and MPE groups created prior to release 4.5.
21U16File allocation date: The date when the file was last restored (in CALENDAR intrinsic format).

Zero is returned as the file allocation date for root directories, MPE accounts, and MPE groups created prior to release 4.5.
22I32Number of open/close records: MSG files only. May not be up-to-date when the file is open.
23CADevice name (8 bytes)
24U32Last modification time: The time when the file was last modified (in CALENDAR intrinsic format). May not be up-to-date when the file is open.
25CAFirst user label (user label 0) (256 bytes): May not be up-to-date when the file is open. Manager (AM if file is within account, otherwise SM) or read/write (R/W) access required.
27RECUnique file identifier (UFID) (20 bytes)
28U32Total number of bytes allowed in file: Equivalent to the file limit measured in bytes. May not be up-to-date when the file is open.
29U32Start of file offset: Indicates the byte offset where user data starts.
30U32Record size (indicates bytes
31U32Block size (indicates bytes)
32U32Extent size (indicates bytes)
33CAFile lockword (8 bytes): Returned if you are the file creator, account manager, or system manager.
34CAVolume restriction (34 bytes): The last two characters indicate the type of restriction, as follows:
0

File is 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)

35CAVolume set names (32 bytes): No restrictions.
36CATransaction management log set id (4 bytes) No restrictions.
37U16Logical device number
38RECTerminated HFS-syntax system absolute pathname: Upon input, the first four bytes are interpreted as a 32-bit unsigned integer specifying the maximum available buffer size in bytes. This maximum available buffer size does not include the four bytes used to represent this size. Upon output, the first four bytes represent the pathname length excluding the null terminator as a 32-bit unsigned integer. The pathname is returned in bytes following the pathname length. Bytes beyond the pathname terminator are undefined. If the maximum available buffer size is incorrect upon input, variables allocated near the buffer can be overwritten or a bounds violation could occur. A zero pathname length is returned for unnamed new files and when an error occurs. Zero is the minimum buffer length upon input for this itemnum.
39U32The current number of hard links to the file
40I32Time of last file access (clock format): The bit assignments are:

  bits 0-7 = hours
  bits 8-15 = minutes
  bits 16-23 = seconds
  bits 24-31 = tenths of seconds

41I32Time of last file status change (clock format): DFThe bit assignments are:

  bits 0-7 = hours
  bits 8-15 = minutes
  bits 16-23 = seconds
  bits 24-31 = tenths of seconds

42U16Date of the last file status change (calendar format): The bit assignments are:

  bits 0-7 = year of century
  bits 8-15 = day of the year

43CAFile owner (32 bytes): The full file owner name. Unused characters are filled with blanks. 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.
44I32File owner identifier: The file owner identifier (UID). Zero is returned as the file owner ID for root directories, MPE accounts, and MPE groups created prior to release 4.5.
45CAFile group (32 bytes): The file group name. Unused characters are filled with blanks. A symbolic zero (ASCII 48 in decimal) is returned as the group for root directories where GIDs have not been explicitly assigned.
46I32File group identifier: The file group identifier (GID). Zero is returned as the group ID for root directories where GIDs have not been explicitly assigned.
47U32File type: Following are valid file types that can be returned:

  0 = Ordinary file
  1 = KSAM/3000
  2 = RIO
  3 = KSAM XL
  4 = CIR
  5 = Native Mode Spool File
  6 = MSG
  7 = KSAM64
  8 = N/A
  9 = Directory
  10-11= N/A
  12 = Pipe
  13 = FIFO
  14 = Symbolic Link
  15 = Device Link

48U32Record type: Following are valid record types that can be returned:

  0 = fixed
  1 = variable
  2 = undefined
  3 = spool block
  4 = root directory
  5 = N/A
  6 = account directory
  7 = group directory
  8 = N/A
  9 = byte stream
  10 = hierarchical directory

49I64Current 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.
50I32KSAM XL File Version: This item returns a value indicating the version number of a KSAM XL file. A value of 1 indicates an original type KSAM XL file. 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.
51I32KSAM XL Parameters: This item returns file information about KSAM XL.
52I32MPE/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

53I32Secure/Release: This item returns a value indicating whether the file is currently secured or released. A value of 1 indicates that the file is secured. A value of zero indicates that the file is released.

Figure 9-5 Foption Bit Summary

[Foption Bit Summary]

Operation Notes


None.

Condition Codes


CCE (2)

Request granted.

CCG (0)

Not returned.

CCL (1)

Request denied. An error occurred. Refer to the fserrorcode and itemerror parameters for more information.

Refer to this intrinsic in the MPE/iX Intrinsics Reference Manual for other codes pertaining to KSAM files.




FGETKEYINFO


FLOCK