Provides a temporary path to write to and atomically inserts it at the destination location on disposal (if Commit was called).
More...
Provides a temporary path to write to and atomically inserts it at the destination location on disposal (if Commit was called).
{
File.WriteAllBytes(atomic.WritePath, fileData);
atomic.Commit();
}
AtomicWrite([Localizable(false)] string path)
Prepares an atomic write operation.
Definition: AtomicWrite.cs:44
- See also
- AtomicRead
◆ AtomicWrite()
NanoByte.Common.Storage.AtomicWrite.AtomicWrite |
( |
[Localizable(false)] string |
path | ) |
|
|
inline |
Prepares an atomic write operation.
- Parameters
-
path | The file path of the final destination. |
◆ Commit()
void NanoByte.Common.Storage.AtomicWrite.Commit |
( |
| ) |
|
Allows the new file to be deployed upon Dispose.
◆ Dispose()
void NanoByte.Common.Storage.AtomicWrite.Dispose |
( |
| ) |
|
|
inline |
◆ DestinationPath
string NanoByte.Common.Storage.AtomicWrite.DestinationPath |
|
get |
The file path of the final destination.
◆ IsCommitted
bool NanoByte.Common.Storage.AtomicWrite.IsCommitted |
|
get |
true
if Commit has been called.
◆ WritePath
string NanoByte.Common.Storage.AtomicWrite.WritePath |
|
get |
The temporary file path to write to.
The documentation for this class was generated from the following file:
- Common/Storage/AtomicWrite.cs