Checks whether a file exists and if it does, returns details of when the file was last modified.
Syntax:
call "CBL_CHECK_FILE_EXIST" using filename
file-details
returning status-code
Parameters
-
filename
- Picture: pic x(n).
-
file-details
- Group predefined as
cblt-fileexist-buf containing
01 cblt-fileexist-buf typedef.
03 cblte-fe-filesize cblt-x8-compx. *> pic x(8) comp-x.
03 cblte-fe-date.
05 cblte-fe-day cblt-x1-compx. *> pic x comp-x.
05 cblte-fe-month cblt-x1-compx. *> pic x comp-x.
05 cblte-fe-year cblt-x2-compx. *> pic x(2) comp-x.
03 cblte-fe-time.
05 cblte-fe-hours cblt-x1-compx. *> pic x comp-x.
05 cblte-fe-minutes cblt-x1-compx. *> pic x comp-x.
05 cblte-fe-seconds cblt-x1-compx. *> pic x comp-x.
05 cblte-fe-hundredths cblt-x1-compx. *> pic x comp-x.
-
status-code
- See
Library Routines - Key.
On Entry:
-
filename
- The file to look for. The name can contain a path, and is terminated by a space. If no path is given, the current directory is assumed.
This routine does not work with filenames containing wildcard characters.
On Exit:
-
cblte-fe-filesize
- The size of the file in bytes.
-
cblte-fe-filedate
- The date the file was created.
-
cblte-fe-filetime
- The time the file was created.
Comments:
CBL_CHECK_FILE_EXIST is not stripe-aware. If you use this routine on a file for which striping is enabled, the details returned refer to the first stripe only. Therefore, use this routine on an individual stripe only and refer to the stripe by the stripe name.
You can check the success of the call by examining RETURN-CODE.