Class AtomicRead
Ensures that a read operation for a file does not conflict with an AtomicWrite for the same file.
Namespace: NanoByte.Common.Storage
Assembly: NanoByte.Common.dll
Syntax
public sealed class AtomicRead : Object
Examples
using (new AtomicRead(filePath))
return File.ReadAllBytes(filePath);
Constructors
AtomicRead(String)
Ensures that a read operation for a file does not conflict with an AtomicWrite for the same file.
Declaration
public AtomicRead(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path of the file that will be read. |
Examples
using (new AtomicRead(filePath))
return File.ReadAllBytes(filePath);
Methods
Dispose()
Declaration
public void Dispose()