Table of Contents

Class AtomicRead

Namespace
NanoByte.Common.Storage
Assembly
NanoByte.Common.dll

Ensures that a read operation for a file does not conflict with an AtomicWrite for the same file.

[MustDisposeResource]
public sealed class AtomicRead
Inheritance
object
AtomicRead
Extension Methods

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.

public AtomicRead(string path)

Parameters

path string

The path of the file that will be read.

Examples

using (new AtomicRead(filePath))
    return File.ReadAllBytes(filePath);

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()