%listitemlocksfilter() function

The listitemlocksfilter() function is used to get a list of the FSI item locks in a dynamic array format.


 bufferLength = %listitemlocksfilter( handle, filter, buffer, bufferLength ) 


Input handle The handle returned by the %startlistilocks() function.
filter A value-mark delimited list of file names.

If the filter is an empty string, then item locks for all files are returned. Some files, such as MDS and FileOfFiles, are not filtered. Therefore, those item locks (if any) are always included in the results.

bufferLength The size of the output buffer.
Output buffer A dynamic array containing the list of item locks.

Each attribute (row) is an item lock entry. Each value (column) within an entry is a piece of data, such as the item-id, date, and so on. The format of the structure is declared in dm,bp,includes locks.inc.


To compile successfully, the statement cfunction fsi.builtin must be included in the source code. This function returns the number of bytes used in the output buffer.

If the buffer was not large enough, then the required size is returned as a negative value. This allows detecting the error, reallocating the buffer to at least that size, and calling again. The buffer variable is populated with a dynamic array containing the list of item locks.


 cfunction fsi.builtin
 hostFSI = "myserver"
 handle = 0
 code = %startlistilocks( hostFSI, &handle )
 filter = ""
 bufferLength = 1000000
 Char buffer[ bufferLength ]
 bufferLength = %listitemlocksfilter( handle, filter, buffer, bufferLength )
 Crt buffer[ 1, bufferLength ]
 code = %endlistilocks( handle )

Note: For a use case, see dm,bp, nt_list-ilocks.