Skip to content

Conversation

vbreuss
Copy link
Member

@vbreuss vbreuss commented Sep 10, 2025

This PR fixes handling of readonly directories during delete operations to properly match Windows behavior. The fix ensures that attempting to delete a readonly directory on Windows throws an IOException with the correct error message and path information.

Key changes:

  • Add test coverage for readonly directory deletion behavior
  • Fix the exception thrown when accessing readonly directories to include the full path

@vbreuss vbreuss self-assigned this Sep 10, 2025
@Copilot Copilot AI review requested due to automatic review settings September 10, 2025 13:04
@vbreuss vbreuss added the bug Something isn't working label Sep 10, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes handling of readonly directories during delete operations to properly match Windows behavior. The fix ensures that attempting to delete a readonly directory on Windows throws an IOException with the correct error message and path information.

Key changes:

  • Add test coverage for readonly directory deletion behavior
  • Fix the exception thrown when accessing readonly directories to include the full path

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
Tests/Testably.Abstractions.Tests/FileSystem/DirectoryInfo/DeleteTests.cs Adds test case for deleting readonly directories with Windows-specific behavior validation
Tests/Testably.Abstractions.Tests/FileSystem/Directory/DeleteTests.cs Adds test case for deleting readonly directories via Directory.Delete method
Source/Testably.Abstractions.Testing/Storage/InMemoryStorage.cs Updates delete operation to properly handle metadata errors for readonly directories
Source/Testably.Abstractions.Testing/Storage/InMemoryContainer.cs Fixes exception to include the full path when access is denied to readonly directories

Copy link

Test Results

    37 files  ± 0      37 suites  ±0   20m 40s ⏱️ -18s
44 195 tests +65  41 764 ✅ +63  2 429 💤 ±0  2 ❌ +2 
85 920 runs  +64  76 887 ✅ +62  9 031 💤 ±0  2 ❌ +2 

For more details on these failures, see this check.

Results for commit 4da05d4. ± Comparison against base commit f764c5c.

@vbreuss vbreuss enabled auto-merge (squash) September 10, 2025 14:45
Copy link

@vbreuss vbreuss merged commit c778e34 into main Sep 10, 2025
12 checks passed
@vbreuss vbreuss deleted the topic/handle-readonly-directories branch September 10, 2025 15:12
Copy link

This is addressed in release v4.3.5.

This was referenced Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working state: released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug try deleting a Readonly directory from MockFileSystem dosn't throw any exception
1 participant