FFUnLock Function | |
UnLock a portion of an opened file.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax FUNCTION FFUnLock(
ptrHandle AS IntPtr,
offset AS DWORD,
length AS DWORD
) AS LOGIC
public static bool FFUnLock(
IntPtr ptrHandle,
uint offset,
uint length
)
Request Example
View SourceParameters
- ptrHandle
- Type: IntPtr
The handle of the opened file you want to unlock. - offset
- Type: DWord
The file offset at which to start unlocking. - length
- Type: DWord
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:
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