LIST DT


General Form:
LIST [title] DT
Where:
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 .

Streams
ColumnPurposeExplanation
1StreamThe # number of the stream
2FilenameThe 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.
3fdThe number of the operating system file descriptor
4startStart sector for a file in a platter (obsolete, now always zero)
5endEnd sector of a file in a platter (obsolete, now always zero)
6nowThe current offset into the file. This is in sectors for archaic platter file access otherwise it is in bytes.
7lockThis will be an asterisk if the stream has been locked using $OPEN.

The second section shows information relating to current database connections and handles.

Connection handles
ColumnPurposeExplanation
1HandleThe handle number may be followed by a * if it is the default connection and a t if temporary tables are redirected to another handle.
2TypeThe type of database e.g. KDB or Oracle. Connection 1 is hard-wired to KISAM.
3DSNThe connection string used in KI_CONNECT
4TransDepthThe current depth of nested transactions, zero if not in a transaction.
5Last errorThis 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.
6StateThe connection state. This will generally be Open.
CatalogFor KDB connections the catalog filename follows row describing the connection.
Database handles
ColumnPurposeExplanation
1HandleThe handle number may be followed by a dash if the handle was autoallocated and will be closed automatically on RUN
2Type/versionThis 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.
3ConnectionThe handle number of the connection that owns the handle, see previous table
4Last errorThis 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.
5Open modeThe 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.
6RowlenThe row length
7PathThe current path for sequential access
8wcountA count of the number of KCML instances holding the table open in W mode. KDB only.
9StateThe handle state, e.g. open, closed, deferred.
10TableNameThe name of an open table
11LastErrnoIf the last operation failed because of a failed system call then the errno value is shown here in brackets. Only applies on wide screen.
12LockCountThe number of row locks held in the table. Wide screen only.
13CacheIdThe 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.

File handles
ColumnPurposeExplanation
1Read accessSet to R if the file has been read
2Write accessSet to W if the file has been written
3DuplicatedSet to D if duplicated e.g. in a $RELEASE
4fdThe number of the operating system file descriptor (Unix) or handle (Windows).
5FilenameThe name of an file opened on the handle. For sockets this will be the associated options string
Lock countThe 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.