#include<nwfile.h> or #include<nwcalls.h>NWCCODE N_API NWLogFileLock2 (NWCONN_HANDLE conn, NWDIR_HANDLE dirHandle, pnstr8 path, nuint8 lockFlags, nuint16 timeOut);
NWLogFileLock2 logs the specified file for exclusive use by the workstation. If bit 0 of lockFlags is set, the server immediately attempts to lock the file.
lockFlags' values are interpreted as follows:
0x00 Log file 0x01 Log and lock the file
When lockFlags is 1, the server attempts to lock a file for the length of time specified by timeOutLimit.
path can specify either a file's complete path name or a path relative to the current working directory. For example, if a file's complete path name is SYS:ACCOUNT/DOMEST/TARGET.DAT and the directory handle mapping is SYS:ACCOUNT, path could point to either of the following:
SYS:ACCOUNT/DOMEST/TARGET.DAT DOMEST/TARGET.DAT
timeOut is specified in units of 1/18 second (0 = no wait).
In DOS and Windows, all access to the network is blocked during any time out period. For this reason, time outs should be kept to an absolute minimum -- a value of 18 or less. (Even though DOS is mono-tasking, the application may be running in a DOSBOX under Windows Enhanced Mode.)
NWLogFileLock2 cannot lock files already logged and exclusively locked by other applications. A file can be locked by a client even if the file does not yet exist. This reserves the file name for use by the client locking it.
The File Log Table contains data locking information used by a NetWare server. The NetWare server tracks this information for each workstation and process. Whenever a file, logical record, or physical record is logged, information identifying the data being logged is entered in the log table. Normally, a set of files or records is logged and then locked as a set. However, a single file or record can also be locked when it is entered in the table.
When using log tables, a task first logs all of the files or records that are needed to complete a transaction. The task then attempts to lock the logged set of files or records. If some of the logged resources cannot be locked, the lock fails and none of the resources are locked.
Synchronization