X"91" function 69

Note: This routine has been deprecated in Net Express 4.0 onwards: it is provided for backward compatibility only. You should instead use the CBL_DIR_SCAN_END routines.

Searches a directory for a given file specification.

Syntax:
call X"91" using result
                 function-code
                 parameter
Parameters:
Using call prototype (see Library Routines - Key) Picture (32-bit systems)
result Group containing: Group containing:
  f-error   cblt-x1-compx   pic x comp-x.
  f-handle   cblt-x2-compx   pic x(2) comp-x.
  f-attrout   cblt-x1-compx   pic x comp-x.
  f-time   cblt-x2-compx   pic x(2) comp-x.
  f-date   cblt-x2-compx   pic x(2) comp-x.
  f-size   cblt-x4-compx   pic x(4) comp-x.
  f-fileout   pic x(n)   pic x(n)
function-code cblt-x1-compx pic x comp-x.
parameter Group containing: Group containing:
  f-action   cblt-x1-compx   pic x comp-x.
  f-attrin   cblt-x1-compx   pic x comp-x.
  f-filein   pic x(m)   pic x(m)
On Entry:
function-code Contains 69.
f-action Defines the action to perform:
0 Find the first matching file
1 Find the next matching file
2 Terminate the search early
3 Find one matching file
f-attrin Attribute byte. All normal files, plus those with the attributes specified by setting this parameter, are to be included. To specify attributes, set the bits as follows:
bit 7 Unused
bit 6 Unused
bit 5 Archived file
bit 4 Subdirectory
bit 3 Unused
bit 2 System file
bit 1 Hidden file
bit 0 Read-only file
f-filein The space-terminated filename specification of the file(s) required. This can contain a drive/directory or any wildcard characters.
On Exit:
f-error Contains a status of the result:
0 Success/file found
1 No more files
2 Error
f-handle The find handle. This field is set by the find-first function (see f-action above) and should not be altered until the corresponding terminate search has been done.
f-attrout Attribute byte of file found:
bit 7 Unused
bit 6 Unused
bit 5 Archived file
bit 4 Subdirectory
bit 3 Volume label
bit 2 System file
bit 1 Hidden file
bit 0 Read-only file
f-time Time file was created, in DOS format:
bits 15-11 Hour, 0-23
bits 10-5 Minute, 0-59
bits 4-0 Bi-second, 0-29
f-date Date file was created, in DOS format:
bits 15-9 Year, 0-119 (1980-2099)
bits 8-5 Month, 1-12
bits 4-0 Day, 1-31
f-size The size of the file in bytes.
f-fileout The name of the file found, space-terminated.
Comments:

To find a single file, use the find-one function.

To find several files, use the find-first function and then use the find-next function repeatedly. When there are no more matching files, find-next returns with 1 in f-error. If you do not keep calling find-next until this happens, you must finish by calling the terminate-search function.

The f-handle field should be set to zero before you execute the find-first or find-one function. After that, if you are using the first/next/terminate sequence this field should not be changed until after the terminate search. If you are using the find-one function this field is automatically reset to 0 after that call.

If at any time f-error returns 1 or 2, a terminate search has been carried out automatically, and you should not execute the terminate-search function.

This routine cannot be used to check the existence of a network share resource, such as \\server1\share1, but it can be used to locate files or directories on that share, such as \\server1\share1\*.

See Also: