call "CBL_GET_CURRENT_DIR" using by value flags by value name-length by reference directory-name returning status-code
Using call prototype (see Key) | Picture | |
---|---|---|
flags | cblt-os-flags | pic x(4) comp-5
or pic x(8) comp-5 (64-bit native programs only) |
name-length | cblt-os-size | pic x(4) comp-5
or pic x(8) comp-5 (64-bit native programs only) |
directory-name | pic x(n). | pic x(n). |
status-code | See Library Routines - Key. |
0 | Success. directory-name contains the current working directory. |
128 | The size of directory-name specified by name-length is not large enough to hold the name of the current working directory. |
129 | The flags parameter is not set to zero. |
Comments:
This routine ensures that name-length is at least as long as the current directory name that is to be returned. If it is not, the routine returns with status-code set to 128. If the flags parameter is not set to zero the routine returns with status-code set to 129.
The name-length parameter is not checked by this routine. It is the responsibility of the calling program to specify a valid name-length and directory-name combination (that is, to ensure that directory-name is at least name-length bytes long). Use the BY VALUE LENGTH OF directory-name SIZE 4" construct to pass the name-length parameter.