Click or drag to resize

FFUnLock64 Function

X#
UnLock a portion of an opened file.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax
 FUNCTION FFUnLock64(
	ptrHandle AS IntPtr,
	offset AS INT64,
	length AS INT64
) AS LOGIC
Request Example View Source

Parameters

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

Return Value

Type: Logic
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