CBL_DIR_SCAN_READ

Searches for the next entry in the file system using a search handle returned by a previous CBL_DIR_SCAN_START.

Syntax:
CALL "CBL_DIR_SCAN_READ" using  by reference   handle
                                               entry
                                   returning   search-status
Parameters:
handle usage pointer.
entry A group item containing the following subordinate items:
attribute cblt-x4-comp5.
date-stamp A group item defined as:
year cblt-x4-comp5.
month cblt-x2-comp5.
day cblt-x2-comp5.
hour cblt-x2-comp5.
minute cblt-x2-comp5.
second cblt-x2-comp5.
millisec cblt-x2-comp5.
dst cblt-x1-comp5.
size cblt-x8-comp5.
name A group item defined as:
max-len cblt-x2-comp5.
entry-name pic x(max-len)
search-status See Library Routines - Key.
On Entry:
handle Set by CBL_DIR_SCAN_START. This field identifies the search operation. Search parameters cannot be changed for a given handle.
max-len The length of the entry-name field.
On Exit:
attribute Describes the properties of the entry found. Valid values are:
Value Bit Set Meaning
1 0 File found
2 1 Directory found
4 2 The entry found is not a file or a directory
8 3 The entry is readable
16 4 The entry is writable
32 5 The entry is hidden
If the entry found is a file, any of bits 3, 4 and 5 may be set, to indicate whether or not the file is readable and so on. These bits may be set if the entry found is not a file, but the meaning in this case is undefined.

Note that this is a return field. The flags in bits 0 to 2 reflect the entry's properties and may not be the same as the search attributes.

date-stamp This group field holds the date and time that the entry was last written. On some systems millisec is set to zero. The final field in date-stamp, dst, is the daylight saving time flag: 1 means that daylight saving was in operation when the entry was last written; 0 means that daylight saving was not in operation.
size The size of the file in bytes.
entry-name The name of the entry found.
Comments:

You can check the success of the call by examining search-status. Zero means success. Any other values are standard run-time system error codes; see the Run-time System Error Messages in Error Messages. Errors associated with an entry-name field that is too small for the result will be ignored. If you do not supply a large enough field, the result will be truncated to fit. If you supply a field that is shorter than max-len you will corrupt memory.

See Also: