Equinox Online Help - Language Reference - A to Z
FileUnlock |
|
---|---|
Applies to | |
Syntax | FileUnlock HandleItem, StartExpression, LengthExpression |
Action | [Statement] Unlocks a specified number of bytes in a random file. |
Scope | Usable anywhere |
Notes | This statement allows you to unlock bytes in a file, preventing access by another user on a network. LengthExpression number of bytes are unlocked, starting at StartExpression. The first byte of the file is byte number 1. To unlock the entire file, supply StartExpression as 1 and LengthExpression as -1. To test if a section of the file is unlocked, attempt the read or write operation required and examine the error return. This statement will not work if the file has been opened as a sequential file. File sharing must be enabled in the operating system. The system workarea SysError is set to 2 if the unlock attempt fails, 1 if an error occurs, otherwise zero. |
Category | File IO |
See Also | FileClose, FileCloseAll, FileDelimiters, FileInput, FileInputLine, FileLock, FileMovePosition, FileOpen, FilePosition, FilePrint, FileRead, FileReadLine, FileReadBinary, FileReadFile, FileUnlock, FileWrite, FileWriteBinary, FileWriteFile |
Example | This method opens a file with sharing enabled, locks some bytes, reads them and then unlocks them. string Buffer |