From 86e0440718884d8490f73526515d9b949ebe439d Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Thu, 1 Jan 2026 14:28:39 +0000 Subject: [PATCH] fix: Address PR review feedback for backward compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change Clean() default to removeReadOnlyAttribute: false for backward compat - Move CopyTo log to start of method for consistency with other operations - Add XML remarks documenting the backward-compatible behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/ModularPipelines/FileSystem/Folder.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ModularPipelines/FileSystem/Folder.cs b/src/ModularPipelines/FileSystem/Folder.cs index 4e3f290fb8..d29da5dc77 100644 --- a/src/ModularPipelines/FileSystem/Folder.cs +++ b/src/ModularPipelines/FileSystem/Folder.cs @@ -95,9 +95,13 @@ public void Delete() /// /// Removes all files and subdirectories within the folder. /// + /// + /// This method preserves backward compatibility by not removing read-only attributes. + /// Use with removeReadOnlyAttribute: true to handle read-only files. + /// public void Clean() { - Clean(removeReadOnlyAttribute: true); + Clean(removeReadOnlyAttribute: false); } /// @@ -153,6 +157,8 @@ public Folder CopyTo(string targetPath) /// A new instance representing the copied folder. public Folder CopyTo(string targetPath, bool preserveTimestamps) { + LogFolderOperationWithDestination("Copying Folder: {Source} > {Destination} [Module: {ModuleName}, Activity: {ActivityId}]", this, targetPath); + Directory.CreateDirectory(targetPath); // Copy all subdirectories first @@ -206,8 +212,6 @@ public Folder CopyTo(string targetPath, bool preserveTimestamps) targetRootDir.LastAccessTimeUtc = DirectoryInfo.LastAccessTimeUtc; } - LogFolderOperationWithDestination("Copied Folder: {Source} > {Destination} [Module: {ModuleName}, Activity: {ActivityId}]", this, targetPath); - return new Folder(targetPath); }