FUNCTION c_lockfil(hname, lockflg)
char *hname; long *lockflg;
The host file name of the file to be locked.
The locking operation. Valid operation codes are:
LOCK (1) : Lock the file UNLOCK (0) : Unlock the file
The c_lockfil() routine is used to lock or unlock a file. A file is locked by creating a lock file in the same directory as the input host file. The lock file is named from the root of the input host file with an extension of "lock". The file is not actually locked for exclusive use, but like processes should check for the existence of this lock file. A file is unlocked by removing the "lock" file.
c_lockfil() returns
E_SUCC (0) --> The locking operation was successful. E_FAIL (-1) --> The locking operation failed due to an error creating or removing the lock file. LOCKED (1) --> The attempt to lock the file failed because the file is already locked by another user.