OPEN Verb - Open File BBj
For this topic's original documentation, see OPEN Verb - Open File.
BBj-Specific Information
Syntax
OPEN (channelno{,MODE=string}{,ISZ=num}{,TIM=int}{,ERR=lineref}) fileid
Description
In BBj 13.0 and above, the TIM=int
option can be used to override the
default timeout value (10 seconds).
BBj supports third party 'plugin' file types. The developer can define a new file type by writing Java classes that implement the interfaces com.basis.plugin.FilePlugin and com.basis.plugin.FileOpenPlugin. For more information, see Java API for BBj.
If the user has written the following Java classes:
com.userFileType
implements FilePlugin
com.userFileTypeOpen implements FileOpenPlugin
and has defined the following alias in the current config.bbx file:
alias J0 com.userFileTypeOpen
then the new file type may be opened using the following syntax:
OPEN (channelno{,MODE=string}{,ERR=lineref})"J0" |
All READs and WRITEs to the channel will then be delegated to the Java
code in com.userFileType.
For further plugin code samples, go to <bbj install dir>/demos/plugins, or see BBj Filesystem Plugin.
For additional information about opening a printer, see Printing in BBj.
NOTE: In BBj, using ISZ= does not automatically LOCK a file. If the file needs to be locked then use the LOCK verb
Note:
In PRO/5 15.01 and higher, and BBj 15.10 and higher, the OPEN verb by default is restricted from opening pipes (commands starting with "<", ">", or "|") in console mode. This is to protect against accidentally overwriting a data file as a side effect of inadvertently specifying a pipe expression. To open a pipe at the console, set SETOPTS byte 9 bit $10$ or include MODE="PIPE" in the OPEN.
Mode |
Value |
Description |
---|---|---|
CRYPTALG= |
AES-128 AES-256 |
Uses AES-128 bit encryption, which is also the default. In BBj 6.0 and higher, and PRO/5 6.0 and higher, uses AES-256 bit encryption. |
FOCUSDELAY= |
Seconds |
Specifies the timeout value for 'FOCUS' (default is 10 seconds) |
BBj-Specific MODE Options
Example 1
Open a channel that READ/WRITEs to the Windows Registry:
|
Example 2
Open a channel that READ/WRITEs to a simple Hashmap:
|