Locks a region in this file.
public void lock( long position, long length )
position
The starting position of the range to be locked.
length
The length of the range to be locked.
WinIOException thrown if an error occurs or if the file has been closed.
Locking a region in a file gives the locking process exclusive access to the specified region. File locks are not inherited by processes created by the locking process. Locking a region in a file denies all other processes both read and write access to the specified region. Locking a region that goes beyond the current end-of-file position is not an error. Locks cannot overlap an existing locked region in the file.
See Also unlock