From cb487991d8551ec72925885bcdcefe49101b4bf8 Mon Sep 17 00:00:00 2001 From: MOHAMMED WASIM KHAN <108329802+wasim-builds@users.noreply.github.com> Date: Mon, 27 Jul 2026 17:39:06 +0530 Subject: [PATCH] Clarify `replaceItem` moves the item (#3674) This change clarifies the documentation of `replaceItem(at:withItemAt:)`. It explicitly states that this operation is identical to a move, and that the item at `existingPath` will be moved to the new location and no longer exist at its original path. --- Sources/_NIOFileSystem/FileSystemProtocol.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/_NIOFileSystem/FileSystemProtocol.swift b/Sources/_NIOFileSystem/FileSystemProtocol.swift index 4fd4ed2cb..8d6d08516 100644 --- a/Sources/_NIOFileSystem/FileSystemProtocol.swift +++ b/Sources/_NIOFileSystem/FileSystemProtocol.swift @@ -306,6 +306,10 @@ public protocol FileSystemProtocol: Sendable { /// a file with a directory and vice versa. After the file or directory at `destinationPath` /// has been replaced, the item at `existingPath` will be removed. /// + /// > Note: This method behaves identically to ``FileSystemProtocol/moveItem(at:to:)``, except that it will replace + /// the item at `destinationPath` if it already exists. The item at `existingPath` is moved to the new location and + /// will no longer exist at its original path. + /// /// - Parameters: /// - destinationPath: The path of the file or directory to replace. /// - existingPath: The path of the existing file or directory.