Report file lock information

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX


The chklock utility reports information about locks on a file. To run the utility, type the following at the command line:

chklock [-options] filename



(optional) One or more of the following options (UNIX only):


Display the process ID that holds each lock, the byte position of each lock, and the length (number of bytes) of each lock.


Display one of the following values:

WT_SHARE = One or more processes have the file opened in update mode.

RD_SHARE = One or more processes have the file opened in input mode.


Display both types of file locks on Oracle Solaris. (See system option #33.)


The name of the file for which you want to retrieve locking information. For ISAM files, this must be the name of the data file (usually filename.is1).


For ISAM files, Synergy DBL locks the first byte of the record in the data file. For other file types, Synergy DBL locks the whole record.

If you run chklock without any options, it reports the position of the first byte of each locked record in the file.

If a process has opened a file in exclusive mode (SHARE:0), chklock returns the message “File locked.” On UNIX, the -p option indicates the process ID that has it locked. (See the last example below.)


In the first example below, two records are locked. One starts at byte 1240 (in the ISAM data file), while the other starts at byte 1535. In the second example, one record is locked starting at byte 129.

$ chklock myfile.is1
1240 1535
$ chklock myfile.ddf

In the following example, one record in the file is locked by process ID number 3209. It starts at byte 0 and it is 129 bytes long.

$ chklock -p myfile.ddf
3209: 0 - 129

The following example indicates that at least one process has opened the file in update mode.

$ chklock -pr myfile.ddf
3209: 0 - 129

In the following example, the file was opened in exclusive mode by process ID number 3209.

$ chklock -p myfile.ddf
3209: File locked