LIST DT
LIST [title] DTWhere:
title = alpha_variable or a literal string
The LIST DT statement displays the current contents of the device table (DT) and device equivalence tables (DET).
The display is divided into five sections, the first lists the device table showing those stream numbers that have been allocated. It is headed up by summary of the current working directory, the number of operating system file descriptors in use and the number available .
Column | Purpose | Explanation |
---|---|---|
1 | Stream | The # number of the stream |
2 | Filename | The filename open on the stream. For a socket this will be the options string from OPEN#. For a connected socket it might be the stream number of the original listening socket. |
3 | fd | The number of the operating system file descriptor |
4 | start | Start sector for a file in a platter (obsolete, now always zero) |
5 | end | End sector of a file in a platter (obsolete, now always zero) |
6 | now | The current offset into the file. This is in sectors for archaic platter file access otherwise it is in bytes. |
7 | lock | This will be an asterisk if the stream has been locked using $OPEN. |
The second section shows information relating to current database connections and handles.
Column | Purpose | Explanation |
---|---|---|
1 | Handle | The handle number may be followed by a * if it is the default connection and a t if temporary tables are redirected to another handle. |
2 | Type | The type of database e.g. KDB or Oracle. Connection 1 is hard-wired to KISAM. |
3 | DSN | The connection string used in KI_CONNECT |
4 | TransDepth | The current depth of nested transactions, zero if not in a transaction. |
5 | Last error | This is enclosed in brackets. If blank the last operation was KE_SUCCESS otherwise the major and minor error numbers appear here together with an errno value from the operating system if applicable. |
6 | State | The connection state. This will generally be Open. |
Catalog | For KDB connections the catalog filename follows row describing the connection. |
Column | Purpose | Explanation |
---|---|---|
1 | Handle | The handle number may be followed by a dash if the handle was autoallocated and will be closed automatically on RUN |
2 | Type/version | This is a letter for the type (K for KDB, O for Oracle, P for PostgreSQL) and a number representing the implementation version e.g. K7 for KDB7 or O2 for current Oracle. |
3 | Connection | The handle number of the connection that owns the handle, see previous table |
4 | Last error | This is only shown if the screen is wide enough. If blank the last operation was KE_SUCCESS otherwise the major and minor error numbers appear here. |
5 | Open mode | The mode used in any KI_OPEN e.g. R, W, X. Cached tables have a mode of C and cached tables with passthrough a mode of c. |
6 | Rowlen | The row length |
7 | Path | The current path for sequential access |
8 | wcount | A count of the number of KCML instances holding the table open in W mode. KDB only. |
9 | State | The handle state, e.g. open, closed, deferred. |
10 | TableName | The name of an open table |
11 | LastErrno | If the last operation failed because of a failed system call then the errno value is shown here in brackets. Only applies on wide screen. |
12 | LockCount | The number of row locks held in the table. Wide screen only. |
13 | CacheId | The cache id representing the version of a cached table. This gets incremented when the table is modified. Wide screen only. |
The third section displays the device equivalence table (DET), which maps device addresses to native filenames and types. The currently SELECTed devices for CI, INPUT, CO, PRINT, LISTand TRACE follow.
The fourth section shows any XML handles currently in use. If no XML handles are currently in use then this section will not be displayed. The display shows the handle number. If the document has not yet been parsed the line includes wither the handle was created with XML_OPEN O or XML_PARSE_BUFFER P. For the former the filename is shown, for the latter the first few bytes of the given buffer. If the document is being processed with XML_NEXT then the first, last and current element names are given, along with the depth of the current tag and its type. See XML_NEXT for more information.
The last section shows the handle table. This lists the file descriptors used by KCML and the files they are associated with.
Column | Purpose | Explanation |
---|---|---|
1 | Read access | Set to R if the file has been read |
2 | Write access | Set to W if the file has been written |
3 | Duplicated | Set to D if duplicated e.g. in a $RELEASE |
4 | fd | The number of the operating system file descriptor (Unix) or handle (Windows). |
5 | Filename | The name of an file opened on the handle. For sockets this will be the associated options string |
Lock count | The number of operating system byte range locks. This immediately follows the filename and a comma. |
If LISTed to the screen, the screen will be cleared before the display, and on pressing RETURN, the subsequent pages of the device table followed by the device equivalence table and its subsequent pages.
Native files are distinguished by having a start sector of zero.
The file descriptor (fd) will be negative if the file or device has not been opened or has been closed and positive if it is open. It is set to 9999 if a device has been temporarily closed as a result of operating systems limits on the number of open files allowed. It will be automatically opened when next used.