DLM Files

The sequence of events received during a monitor session can be written to a file using the DLM File API. The API is used in a way analogous to the C Language Standard IO library functions, except that reading and writing are done in units of DlmEvents

To write a file:

  1. Call dlm_FileOpen() with dlm_FILE_MODE_WRITE to allocate resources and get a file id.
  2. Call dlm_FileWrite() repeatedly to write events to the file.
  3. Call dlm_FileClose() to free associated resources.

Ownership of the events being written remains with the application.

To read a file:

  1. Call dlm_FileOpen() with dlm_FILE_MODE_READ to allocate resources and get a file id.
  2. Call dlm_FileRead() repeatedly to read events from the file.
  3. Call dlm_FileClose() to free associated resources.

As an alternative to 2 above, you can call dlm_FileReadEvents() and provide a callback to read all of the events from the file. The callback mechanism is almost identical to that used by the Monitor API and described under dlm_MonOpen() with one exception: reading stops if the callback function returns a negative value such as dlm_ERROR_END_OF_FILE.

Ownership of the events read is transferred to the application. Events read with either dlm_FileRead() or dlm_FileReadEvents() must eventually be released back to the file session by calling dlm_FileReleaseEvent().