You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add Phase 2 Activity-based logging to FileSystem operations (#1694)
* feat: Enhance Folder.Clean() and CopyTo() methods with additional options
- Add Clean(bool removeReadOnlyAttribute) overload that:
- Handles read-only files/directories by removing the attribute before deletion
- Adds try-catch with logging for resilience when individual items fail
- Includes private helper RemoveReadOnlyAttributeRecursively(DirectoryInfo)
- Default Clean() calls Clean(removeReadOnlyAttribute: true)
- Add CopyTo(string targetPath, bool preserveTimestamps) overload that:
- Preserves file and directory attributes
- Optionally preserves CreationTimeUtc, LastWriteTimeUtc, LastAccessTimeUtc
- Preserves root directory timestamps after all content is copied
- Default CopyTo(targetPath) calls CopyTo(targetPath, preserveTimestamps: true)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: Address PR review feedback for Folder enhancements
- Fix RemoveReadOnlyAttributeRecursively to use TopDirectoryOnly with recursion
instead of AllDirectories (performance improvement)
- Change CopyTo log message to past tense "Copied Folder" (logging consistency)
- Remove try-catch from Clean() to preserve exception-throwing behavior
(backward compatibility)
- Change CopyTo() default to preserveTimestamps: false (backward compatibility)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: Add Phase 2 Activity-based logging to FileSystem operations
- Add GetCurrentModuleName() and GetCurrentActivityId() helper methods to
ModuleActivityTracing for retrieving activity context
- Update File.cs logging methods to include module name and activity ID
in all file operations (read, write, copy, move, delete, create, append)
- Update Folder.cs logging methods to include module name and activity ID
in all folder operations (create, delete, clean, copy, move, get, search)
- Add private helper methods LogFileOperation, LogFileOperationWithDestination,
LogFolderOperation, LogFolderOperationWithDestination, LogFolderOperationWithExpression,
and LogFolderWarning for consistent activity context logging
This is Phase 2 of the Activity-based refactor, which uses Activity.Current
for context alongside the existing AsyncLocal pattern for backward compatibility.
The log messages now include the current module name and activity ID when available.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
0 commit comments