XsFileStream.Lock Method | |
Prevents other processes from reading from or writing to the FileStream.
Namespace:
XSharp.IO
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax VIRTUAL METHOD Lock(
position AS INT64,
length AS INT64
) AS VOID
public override void Lock(
long position,
long length
)
Request Example
View SourceParameters
- position
- Type: Int64
The beginning of the range to lock. The value of this parameter must be equal to or greater than zero (0). - length
- Type: Int64
The range to be locked.
Exceptions Exception | Condition |
---|
ArgumentOutOfRangeException | position or length is negative. |
ObjectDisposedException | The file is closed. |
IOException | The process cannot access the file because another process has locked a portion of the file. |
See Also