Hierarchical file system APIs

This topic describes how the use of HFS APIs is different for the optical file system, as compared to general API use.

Although the APIs that HFS supports are common to all file systems, each file system has different interpretations or restrictions regarding those APIs. The following table summarizes the optical interpretation of each HFS API. LAN-attached optical devices and directly attached optical devices have different restrictions for several of the APIs. Some examples of directly attached optical devices are CDs, DVDs, and SCSI attached optical libraries. Some examples of LAN-attached optical devices are Ethernet or token ring attached optical libraries.

Table 1. Optical HFS API restrictions
HFS APIs Directly attached usage notes LAN-attached usage notes
Change File Pointer (QHFCHGFP) None. None.
Close Stream File (QHFCLOSF) None. None.
Control File System (QHFCTLFS) Supports the following requests:
  • SAV saves a held optical file.
  • RLS releases a held optical file.
  • SRD/VOL returns a sector read from an optical volume.
  • SRD/DEV returns a sector read from an optical device.
  • RTV/VOL returns volume-specific information.
  • GET reads file data directly from the media with minimal data caching. For UDF formatted volumes, GET requires *X authority to each directory in the path preceding the file and *R authority to the file.
Supports the following requests:
  • UPD/LAN performs a dynamic index refresh of the list of LAN volumes.
  • UPD/VOL returns volume-specific information.
  • RTV/VOL returns volume-specific information.
  • RTV/DIR returns subdirectory and file entries for a specified directory.
Copy Stream File (QHFCPYSF) If the source file is in the QOPT file system, *USE authority is required to the source optical volume.

If the target file is in the QOPT file system, *CHANGE authority is required to the target optical volume. Copy information parameter, byte 1, option 2 is not supported (Copy Append). If specified, CPF1F62 will be returned.

When the operation is complete, QCRTDTTM, QACCDTTM, and QWRTDTTM are set to the current date.

When copying between the QOPT and QDLS file systems, file attributes are optionally copied depending on global optical attribute CPYATR. This attribute can be displayed or changed utilizing the CHGOPTA command.

When copying between the QOPT and QDLS file systems, file permissions are not copied. If permissions need to be preserved between these file systems use the copy (CPY) CL command.

If the source file is on a UDF formatted volume, *X authority is required to each directory in the path preceding the file. *R authority is required to the file.

If the target file is on a UDF formatted volume, *WX authority is required to the parent directory and *X authority is required to each directory in the path preceding the parent directory.

If the source file is in the QOPT file system, *USE authority is required to the source optical volume.

If the target file is in the QOPT file system, *CHANGE authority is required to the target optical volume. Copy information parameter, Byte 1, Option 2 is not supported (Copy Append).

Copying from a volume in a directly attached library to a volume in a LAN-attached optical device is not supported.

Create Directory (QHFCRTDR) When the operation is complete, QCRTDTTM, QACCDTTM, QWRTDTTM are set to the current date.

When the operation is complete, QFILSIZE and QALCSIZE are set to 0.

Requires *CHANGE authority to the optical volume.

Creating the optical root directory is not supported.

Creating the volume portion of the directory is not supported.

Attributes passed in the attribute information table are not supported, and will result in a CPF1F71 error message. The length of the attribute information table parameter must be 0.

Optical attribute OPT.CHGATDTTM, which indicates the last time that the directory attributes were changed, is created. This date is set to the current date. If a user specifies an attribute, it is ignored.

For UDF formatted volumes, *WX authority is required to the parent directory. *X authority is required to each directory in the path preceding the parent directory. The owner of the directory will be the user creating the directory and the owner data authorities will be set to *RWX. The primary group and primary group data authorities will be the same as the parent directory. The *PUBLIC data authorities will be the same as the parent directory.

When the operation is complete, QCRTDTTM, QACCDTTM, QWRTDTTM are set to the current date.

When the operation is complete, QFILSIZE and QALCSIZE are set to 0.

Requires *CHANGE authority to the optical volume.

Creating the optical root directory is not supported.

Creating a volume portion of a directory is not supported.

All standard attributes are ignored.

The length of attribute information table parameter must be set to 0.

Delete Directory (QHFDLTDR) Deleting the optical root directory is not supported.

Deleting the volume portion of a path is not supported.

Requires *CHANGE authority to the optical volume.

For UDF formatted volumes, *WX authority is required to the parent directory and *X authority is required to each directory in the path preceding the parent directory. *W authority is required to the directory being deleted.

Deleting the optical root directory is not supported.

Deleting the volume portion of a path is not supported.

Requires *CHANGE authority to the optical volume.

Delete Stream File (QHFDLTSF) Requires *CHANGE authority to the optical volume.

For UDF formatted volumes, *WX authority is required to the parent directory. *X authority is required to each directory in the path preceding the parent directory. *W authority is required to the file being deleted.

Requires *CHANGE authority to the optical volume.
Get File Size (QHFGETSZ) None None
Set File Size (QHFSETSZ) None Not Supported
Open Stream File (QHFOPNSF) Parameter open information:
  • Opening with an access mode (byte 6) of write only or read/write requires *CHANGE authority to the volume.
  • Opening with an access mode (byte 6) of read only requires *USE authority to the volume.
  • Lock Modes (byte 5) are enforced across different open instances. If the same job opens a file multiple times, these open locks can conflict.

If QALCSIZE was specified on an open request for the write operation, optical media will be checked to see if enough space is available. If not, error message CPF1F62 is returned.

All standard attributes except QALCSIZE are ignored.

If a file is being created, QCRTDTTM, QACCDTTM, and QWRTDTTM are set to the current date. If a file is being updated, QWRTDTTM is set to the current date. If a file is being read, no time stamps are changed. QACCDTTM is never changed after a file is created. It will always equal QCRTDTTM.

The following authorization rules apply only for UDF formatted volumes.
  • If opening a file for READ, *X authority is required to each directory in the path preceding the file and *R authority is required to the file.
  • If opening an existing file for WRITE, *X authority is required to each directory in the path name preceding the file and *W authority is required to the file.
  • If opening an existing file for READ/WRITE, *X authority is required to each directory in the path name preceding the file and *RW authority is required to the file.
  • If creating the file, *WX authority is required to the parent directory.
  • If creating the file, the owner of the file will be the user creating the file and the owner data authorities will be set to *RWX. The primary group and primary group data authorities will be the same as the parent directory. The *PUBLIC data authorities will be the same as the parent directory.
Parameter Open information:
  • Byte 3 (write-through flag), is not supported.
  • Byte 7 (type of open operation to perform), is not supported.
  • Opening with an access mode (byte 6) of read-only requires *USE authority to the volume.

Unless the file open attempt is for read-only access, attributes are not tolerated and result in error message CPF1F71. The length of the attribute information table parameter must be 0.

If a file open attempt is for read-only access, attributes are tolerated but ignored.

Read Stream File (QHFRDSF) None. None.
Retrieve Directory Entry Attributes (QHFRTVAT) Requires *USE authority to an optical volume.

For UDF formatted volumes, *X authority is required to each directory in the path name preceding the file and *R authority is required to the file or directory being read.

The user can retrieve only LAN-standard attributes: QFILSIZE, QCRTDTTM, and QWRTDTTM.

Requires *USE authority to an optical volume.

The length of attribute information table parameter must be set to 0.

Write Stream File (QHFWRTSF) None. None.
Change Directory Entry Attributes (QHFCHGAT) QFILATTR is the only standard attribute that can be changed. All others that are specified are ignored.

Read only flag, byte 1 of the QFILATTR attribute, can only be set for a file, not a directory. If specified for a directory, it is ignored.

Changed flag, byte 5 of the QFILATTR attribute, can be set to either 0 or 1. It is automatically set on (1) whenever a file is created or written to.

If OPT.CHGATDTTM is specified, it is ignored.

Requires *CHANGE authority to an optical volume.

For UDF formatted volumes, *X authority is required to each directory in the path name preceding the file and *W authority is required to the file.

API not supported.
Close Directory (QHFCLODR) None. API not supported.
Force Buffered Data (QHFFRCSF) If the volume media format is *UDF, then data is forced to optical media.

If the volume media format is not *UDF, then data is forced to internal disk storage, not to optical media.

For a file opened for read-only access, this API has no effect.

API not supported.
Lock and Unlock Range in Stream File (QHFLULSF) None. API not supported.
Move Stream File (QHFMOVSF) If the source file is in the QOPT file system, *CHANGE authority is required to the optical source volume.

If the target file is in the QOPT file system, *CHANGE authority is required to the optical target volume.

When moving between the QOPT and QDLS file systems, file attributes are optionally copied depending on the global optical attribute CPYATR. This attribute can be displayed or changed using the CHGOPTA command.

If the source file is on a UDF formatted volume, *WX authority is required to the parent directory and *X authority is required to each directory in the path name preceding the parent directory. *RW authority is required to the file.

If the target file is on a UDF formatted volume, *WX authority is required to the parent directory and *X authority is required to each directory in the path name preceding the file.

API not supported.
Open Directory (QHFOPNDR) Opening the file system root (/QOPT) will allow both directly attached and LAN-attached volumes to be returned on Read Directory Entries.

Lock mode is ignored when opening the file system root.

Lock mode of no lock is not supported. If requested, a lock mode of deny none is substituted.

Requires *USE authority to the optical volume.

For UDF formatted volumes, *X authority is required to each directory in the path name preceding the directory being opened and *R authority is required to the directory being opened.

API not supported.
Read Directory Entries (QHFRDDR) QNAME is returned without the QOPT file system name.

QNAME is the only field that is set for a LAN-attached volume.

QWRTDTTM will always equal QCRTDTTM.

For files and directories, QACCDTTM will always equal QCRTDTTM.

For volumes, QACCDTTM will equal the last volume reference date.

API not supported.
Rename Stream File (QHFRNMSF) Requires *CHANGE authority to the optical volume.

For UDF formatted volumes, *WX authority is required to the parent directory and *X authority is required to each directory in the path name preceding the parent directory. *W authority is required to the file being renamed.

API not supported.
Rename Directory (QHFRNMDR) API not supported. API not supported.