Get Stream File Size (QHFGETSZ) API


  Required Parameter Group:

1 Open file handle Input Char(16)
2 File size Output Binary(4) Unsigned
3 Error code I/O Char(*)

  Default Public Authority: *USE

  Threadsafe: No

The Get Stream File Size (QHFGETSZ) API returns the current size of a stream file's data, in bytes, as of the last write operation to the file.


Authorities and Locks

None.


Required Parameter Group

Open file handle
INPUT; CHAR(16)

The file handle returned when the file was opened with the Open Stream File (QHFOPNSF) API.

File size
OUTPUT; BINARY(4) UNSIGNED

The number of bytes of data in the file as of the last write operation. This number is either the last offset written plus 1 or the size set with the Set Stream File Size (QHFSETSZ) API whichever is higher.

This size can differ from the value of the QFILSIZE attribute, which is the size of the file as of the last close operation. In addition, it is the size of the file's data only and does not include the size of any object information stored by the file system. If your file system stores object or other information with the file, the file's allocated size is larger than this size.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error Code Parameter.


Error Messages

Message ID Error Message Text
CPF1F25 E File handle not valid.
CPF1F28 E Damaged file.
CPF1F41 E Severe error occurred while addressing parameter list.
CPF1F52 E Error code not valid.
CPF1F62 E Requested function failed.
CPF1F66 E Storage needed exceeds maximum limit for user profile &1.
CPF1F71 E Exception specific to file system occurred.
CPF1F72 E Internal file system error occurred.
CPF1F73 E Not authorized to use command.
CPF1F74 E Not authorized to object.
CPF1F82 E Function not supported.
CPF1F87 E Missing or damaged exit program &2.
CPF3C90 E Literal value cannot be changed.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.


API introduced: V2R1
Top | Hierarchical File System APIs | APIs by category