Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

bs2fstat - get BS2000 file names from catalog (BS2000)

&pagelevel(4)&pagelevel

Syntax

#include <stdlib.h>

int bs2fstat(const char *pattern, void ( *function)(const char *filename, int len));

Description bs2fstat returns the fully-qualified file names (:catid:$userid.filename) of files that


satisfy the selection criterion given by pattern along with the length of each respective file
name, including the terminating null byte (\0).

For each file found, bs2fstat calls a given function (which must be supplied by the user)
and passes to it the particular filename (string char *) and the name length len (integer) as
current arguments.

const char *pattern is a string specifying the selection criterion for one or more files.

pattern is a fully or partially qualified file name with wildcard syntax

For compatibility reasons, further parameters may be specified to determine which files are
selected, e.g.:

file and catalog attributes (FCBTYPE, SHARE, etc.)

creation and access date (CRDATE, EXDATE, etc.)

These parameters must be specified in the syntax of the ISP command FSTAT.

The pattern "*,crdate=today", for example, returns the names of all files that were created
or updated on today's date.

void ( *function)(const char *filename, int len) is a user-supplied function with the
parameters filename (file name) and len (name length). These parameters are supplied with
current values by bf2stat at each function call. The function calls are made automatically
by bs2fstat (in a while loop) .

Return val.

0                       if successful.

DMS error message code

if an error occurs.

Notes

The flag for DMS error message codes can be only queried from outside the user-defined
function, since the function is not called if the search was unsuccessful

See also

system(), stdio.h.