Method for locking the file
This section explains the locking mechanisms used in HULFT.
For details, refer to Exclusive Control between HULFT and User Job.
In HULFT for zOS
HULFT allocates the file in either shared mode (DISP=SHR) or in exclusive mode (DISP=OLD) before the file is opened.
In HULFT for IBMi
The file is locked by the ALCOBJ command before it is opened.
In HULFT for Linux/AIX
Method for locking a local file
HULFT locks the target file by the lockf() function after the file is opened. If the file is locked by the lockf() function and closed without unlocking it, the file is automatically unlocked. Note that lockf64() is used if the operating system provides large file support.
As for the receive file, in addition to the locking method with lockf() function, HULFT locks the real file name with its unique locking method before the file is opened. This locking method has been applied since HULFT Ver. 6. 3. 1, which is a locking method used for receive files in HULFT's Receive system. This locking method controls the locking using the receive file lock control file (HULPATH/.#hulrcv_file.lock).
Regarding the exclusive control between HULFT and user jobs with a receive file, an interface must be established using the locking method that employs the lockf() function. You cannot use the unique locking method of HULFT against the real file name.
Method for locking a networked file
HULFT uses HULFT's unique networked file locking. In addition, after opening the file, HULFT locks the file with the lockf() function.
You can use the networked file if HULFT10 Enterprise grade is installed.
In HULFT for Windows
Method for locking a local file
HULFT locks a local file with a mutex object before the file is opened.
Further, shared mode is set by using the CreateFile() function when opening the file.
Method for locking a networked file
Before a networked file is opened, HULFT applies a lock with a mutex object and then applies HULFT's networked file locking to the file.
Further, shared mode is set by using the CreateFile() function when opening the file.
You can use the networked file if HULFT10 Server grade is installed.