Cache 루틴에서 입출력을 위해 File을 열 때 사용하는 여러가지 모드를 모아 보았다. 현재 2009.1 버전 기준.
참고로, 이 자료는 InterSystms DB 문서에서 "OPEN Mode Parameters" 라는 키워드로 찾으면 나온다.
http://docs.intersystems.com/cache20091/csp/docbook/DocBook.UI.Page.cls?KEY=GIOD_rmsseqfiles#GIOD_rmsseqfiles_openmodeparams
OPEN Mode Parameters
Letter Code |
Keyword |
Description |
N |
/NEW |
New file. If the specified file does not exist, Caché creates the file. If the specified file already exists, Caché creates a new one with the same name. The status of the old file depends on which operating system you are using. On UNIX and Windows, Caché deletes the old file. (Note that file locking should be used to prevent two concurrent processes using this parameter from overwriting the same file.) On OpenVMS, Caché supersedes the old file with a new file with a higher version number; the old file is not deleted.
If the “N” option is not specified and the file specified in OPEN does not exist, the Windows and UNIX default is to not create a new file; the OpenVMS default is to create a new file. This behavior is configurable using the $ZUTIL(68,3) and $ZUTIL(69,3) functions.
|
E |
/CREATE
/CRE
|
(UNIX) Create a file if it does not exist. Does not delete and recreate an existing file, as the N mode does. The default is to not create a new file. This default is overridden if $ZUTIL(68,3) or $ZUTIL(69,3) is enabled. |
D |
|
Delete File: Specifies that the file should be automatically deleted when it is closed. /DELETE or /DELETE=n for nonzero values of n enable the parameter code. /DELETE=n for a zero value of n disables the parameter code. The default is to not delete a file. |
R |
/READ |
Read: Caché permits READ access the file. Other processes may also access this file (however, see “L” parameter). If you attempt to open a nonexistent file in “R” mode, the process hangs. To prevent this situation, use a timeout. “R” is the default for Windows and UNIX. “RW” is the OpenVMS default. This system default is configurable using the $ZUTIL(69,2) function. |
W |
/WRITE
/WRI
|
Write: Caché permits WRITE access to the file. In Windows and UNIX, “W” gives the process shared write access to the file, with exclusive write access to the record. Use “WL” to specify exclusive write access to the file. In OpenVMS, “W” gives exclusive write access to the file. If you attempt to open a nonexistent file in “W” mode, the process hangs until the file is created or the process is resolved by a timeout, a Process Terminate, or RESJOB. “R” is the default for Windows and UNIX. “RW” is the OpenVMS default. This system default is configurable using the $ZUTIL(69,2) function. |
L |
|
Locked Exclusive: Use this option with the “W” (Write) option to specify exclusive write access to a file. “WL” or “WRL” specifies that the current process has exclusive write access to the file. A file opened with “RL” may still have shared read access. The effects of the “L” option on concurrent opens are different in Windows and UNIX. Refer to the “OPEN Mode Locking” section, below, for further details. On UNIX systems if one process specifies “WL” (or “WRL”) access to a file, other processes requesting read access to that file must specify “RL” so that UNIX can coordinate file locking. This option is not used by OpenVMS, and is ignored. OpenVMS opens a file in “W” mode for exclusive write access by default. To override this OpenVMS behavior, use the RMS file “H” (shared) mode parameter. |
A |
/APPEND
/APP
|
Append: WRITE operations append data to the end of an existing file. The default is to overwrite existing data, rather than append. |
S |
/STREAM |
Stream format with carriage return, line feed, or form feed as default terminators. Jobbed processes that inherit TCP devices are automatically set to “S” format. You can reset the format with the USE command. S, V, F, and U modes are mutually exclusive. Stream record format is the default on non-OpenVMS systems. Variable length is the default on OpenVMS systems. |
V |
/VARIABLE |
Variable length: Each WRITE creates one record. For Windows and UNIX, you specify the maximum record length in the reclen argument. OpenVMS automatically handles the record length during a WRITE. Do not attempt to insert records in a variable-length sequential file; a WRITE will render inaccessible all data in the file from the point after the WRITE on. S, V, F, and U modes are mutually exclusive. Stream record format is the default on non-OpenVMS systems. Variable length is the default on OpenVMS systems. |
F |
/FIXED
/FIX
|
Fixed length: Each record is the length specified in the reclen argument. All data written is packed into fixed-length records. For example:
OPEN "myfile":("NWF":4) USE "myfile" WRITE "ABC","DEF","GHI","JKL"
produces the following three records: ABCD EFGH IJKL. This works only for READ operations (not WRITE operations). S, V, F, and U modes are mutually exclusive. OpenVMS RMS files cannot use this option; use RMS “B” (block) mode instead. |
U |
/UNDEFINED |
Undefined length: Specifies that file records have an undefined length and therefore READ operations must specify the number of characters to read. No translation on output. Default value is the maximum string length, currently 32,767 characters. S, V, F, and U modes are mutually exclusive. |
K\name\
Knum
|
/TRANSLATE[= n]: /IOTABLE[= name]
|
I/O Translation Mode: When you use the “K” parameter for a device, I/O translation will occur for that device if translation has been enabled system-wide. You identify the previously defined table on which the translation is based by specifying the table's name. When using keywords you specify /TRANSLATE to enable I/O translation (n=1 to enable; n=0 to disable), and /IOTABLE=name to specify the translation table to use. The + and - options for turning protocols on and off are not available with the K protocol. (The older form Knum, where “num” represents the number of the slot the table is loaded in, is being phased out but is still supported. The system manager can display slot numbers in the %NLS utility in the selection window for each table type.) This parameter may be used with either the OPEN command or the USE command. |
Y\name\
Ynum
|
|
$X/$Y Action Mode: When you use the “Y” parameter for a device, the system uses the named $X/$Y Action Table. You identify the previously defined $X/$Y Action Table on which translation is based by specifying the table's name. $X/$Y action is always enabled. If “Y” is not specified and a system default $X/$Y is not defined, a built in $X/$Y action table is used. The + and - options for turning protocols on and off are not available with the Y protocol. (The older form Ynum, where “num” represents the number of the slot the table is loaded in, is being phased out but is still supported. The system manager can display slot numbers in the NLS utility in the selection window for each table type.) This parameter may be used with either the OPEN command or the USE command. |
|