Skip to content
API referenceDevelopmentEngine APIEngine ccf7d03f
Synced
  • Publishes a complete directory at an unoccupied path without replacing an existing destination.

API: engine
Project: Inno.Core.IO

public static void Inno.Core.IO.AtomicDirectory.Publish(string source, string destination, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))

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.

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.

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.