AtomicDirectory.Publish
Section titled “AtomicDirectory.Publish”
- Publishes a complete directory at an unoccupied path without replacing an existing destination.
Required contracts
Section titled “Required contracts”API: engine
Project: Inno.Core.IO
Declaration
Section titled “Declaration”public static void Inno.Core.IO.AtomicDirectory.Publish(string source, string destination, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))Parameters
Section titled “Parameters”Parameter source: The complete candidate directory, disjoint from the destination.
Parameter destination: The unoccupied publication path on the same filesystem.
Parameter cancellationToken: Cancels preparation or bounded waits before the rename commits.
Remarks
Section titled “Remarks”Windows access and sharing failures are retried for at most two seconds to tolerate temporary readers. Cancellation observed after a blocked rename takes precedence over its timeout error. Failure preserves the candidate and any existing destination. A committed rename is not canceled afterward.
Exceptions
Section titled “Exceptions”Exception T:System.ArgumentException: A path is blank or the two directory trees overlap.
Exception T:System.IO.DirectoryNotFoundException: The source directory does not exist.
Exception T:System.IO.IOException: The destination exists, the filesystem cannot rename the tree, or a transient block persists.
Exception T:System.UnauthorizedAccessException: The operating system continues denying access after the bounded retry window.
Exception T:System.OperationCanceledException: Cancellation is observed before publication, including while handling a failed rename.