home *** CD-ROM | disk | FTP | other *** search
- Unit ABShare;
- {
- Share & Record Locking Routines for TP 6.0
-
- Copyright (c) 1991,1992 A.B.S. - ALL RIGHTS RESERVED
-
- 1.00
- }
-
- {$A-,B-,D-,F+,I-,N-,O+,R-,S-,V-}
-
- Interface
-
- Const
- ABShareVer = '1.00';
-
- Function LockRec(FileHandle : Word; FilePosition, FileLength : LongInt;
- UnLock : Boolean) : Word;
- {
- Lock or UnLock a Region of a File for exclusive access. Share must
- be loaded. A call to Lock must be followed by a call to UnLock
- with the same FilePosition and FileLength.
-
- FileHandle - FileRec(f).Handle, f is a variable of type file
- FilePosition - Offset of Region to Lock/UnLock
- FileLength - Length of Region to Lock/UnLock
- UnLock - True to UnLock, False to Lock
-
- Returns:
- 00h - successful
- 01h - function number invalid
- 06h - invalid handle
- 21h - lock violation
- 24h - sharing buffer overflow
- }
-
- Function UpdateFile(FileHandle : Word) : Word;
- {
- Updates a file to disk by opening and closing a duplicate handle
-
- FileHandle - FileRec(f).Handle, f is a variable of type file
-
- Returns:
- 00h - successful
- 04h - too many open files (no handles available)
- 06h - invalid handle
- }
-
- Function ShareInstalled : Boolean;
- {
- Returns True if Share is Installed, otherwise False
- }
-