Click or drag to resize

FFUnLock Function

Unlock a portion of an opened file.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.4a
Syntax
 FUNCTION FFUnLock(
	ptrHandle AS IntPtr,
	offset AS DWORD,
	length AS DWORD
) AS LOGIC
View Source

Parameters

ptrHandle
Type: IntPtr
The handle of the opened file you want to unlock.
offset
Type: UInt32
The file offset at which to start unlocking.
length
Type: UInt32
The number of bytes to unlock.

Return Value

Type: Boolean
TRUE if successful; otherwise, FALSE.
Remarks
FFUnlock() unlocks a specified portion of a file.
This permits other processes to access that portion.
The unlocked portion must have been previously locked.
Examples
This example uses FFLock() and FFUnlock() to lock and then unlock the first 300 bytes of a file:
X#
1ptrHandle := FOpen2("c:\data\myfile.txt", ;
2        FO_READWRITE + FO_SHARED)
3IF FFLock(ptrHandle, 0, 300)
4    ? "Locked OK"
5    IF FFUnlock(ptrHandle, 0, 300)
6        ? "Unlocked OK"
7    ENDIF
8ENDIF
See Also