NWLogFileLock2(3nw)


NWLogFileLock2 -- logs the file in the File Log Table and locks it if the lock flag is set

Synopsis

   #include<nwfile.h> 
   or 
   #include<nwcalls.h> 
   

NWCCODE N_API NWLogFileLock2 (NWCONN_HANDLE conn, NWDIR_HANDLE dirHandle, pnstr8 path, nuint8 lockFlags, nuint16 timeOut);

Description

The parameters are as follows:

conn
(IN) Specifies the NetWare server connection handle.

dirHandle
(IN) Specifies the directory handle of the new directory's root directory.

path
(IN) Points to the string containing the name and path of the new directory.

lockFlags
(IN) Specifies the lock flags.

timeOut
(IN) Specifies the length of time the NetWare server attempts to log the specified file before timing out.

Return values

0x0000
SUCCESSFUL

0x8801
INVALID_CONNECTION

0x897F
ERR_LOCK_WAITING

0x8982
NO_OPEN_PRIVILEGES

0x8996
SERVER_OUT_OF_MEMORY

0x8998
VOLUME_DOES_NOT_EXIST

0x899B
BAD_DIRECTORY_HANDLE

0x899C
INVALID_PATH

0x89FE
TIMEOUT_FAILURE

0x89FF
LOCK_ERROR

Notices

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.

Services

Synchronization

NCP calls

0x2222 03
Log File

0x2222 23 17
Get File Server Information

References

NWClearFileLock2(3nw), NWClearFileLockSet(3nw), NWLockFileLockSet(3nw), NWReleaseFileLock2(3nw)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.