Previous Topic Next topic Print topic


CBL_OPEN_FILE

Opens an existing file for byte-stream operations.

Syntax:

call "CBL_OPEN_FILE" using filename
                           access-mode
                           deny-mode
                           device
                           file-handle

Parameters:

  Using call prototype (see Key) Picture
filename pic x(n). pic x(n).
access-mode cblt-x1-compx. pic x comp-x.
deny-mode cblt-x1-compx. pic x comp-x.
device cblt-x1-compx. pic x comp-x.
file-handle cblt-bytestream-handle. pic x(4) comp-5.

On Entry:

filename
Space- or null-terminated filename of the file to be opened. You can use spacey filenames if you put double quotation marks around them. You can use embedded environment variables and library names in filename; for more information see the chapter Filenames in yourFile Handling book.
access-mode
Defines access mode:
1 Read only
2 Write only (deny-mode must be 0)
3 Read/write
64 File can be greater than 4GB. Combine this value with the required access; for example, for read/write access of such files, set 67.
deny-mode
Defines deny mode:
0 Deny both read and write (exclusive)
1 Deny write
2 Deny read
3 Deny neither read nor write
device
Reserved for future use (must be 0).

On Exit:

file-handle
Returns a file handle for a successful open.

Comments:

The success of the call can be checked by examining RETURN-CODE.

If you are requesting 64-bit file access to an unknown remote file system, ensure you set the remote_64bit_access tunable.

Previous Topic Next topic Print topic