Skip to main content

Using File Handles

These handles can be used to retrieve all FIN(n, keyword) values as properties for the file. For example, to retrieve the pathname of a file, you could access the property 'Pathname$ from a file object.

Setting a property on a Pseudo file object is functionally equivalent to issuing a 'OPTION'("name","value") against the file where "name" is the property name specified. For example, to set a file to be buffered, you could set its 'Buffered property to 1.

Typical Pseudo File Properties

Typical pseudo file properties are:

Pseudo-PropertyDescription
'CurKnoReturns the current key number being referenced.
'ExtractReturns 1 if a record currently extracted; otherwise 0.
'FileLengthSize of the file in bytes.
'Key_sizeReturns the external key size of the file.
'LCL_Ctime$File creation time (local time).
'MaxRecMaximum records allowed in the file.
'Pathname$Returns the pathname of the file.
'Record_sizeMaximum record size.
'Records_usedNumber of records in use in the file.
'UTC_Ctime$File creation time as a Universal time.

Example:

Sysobj=new("*SYSTEM")
FileHdl=SysObj'File(5) ! This will yield a pseudo handle to the file open on channel 5
…
if FileHdl'EXTRACT \
     then write (5) \
     else write (5,key=_Key$)