Skip to content

Conversation

@asder8215
Copy link
Contributor

@asder8215 asder8215 commented Dec 23, 2025

This PR modifies checking if a file exists from using .exists() to .try_exists() (handling it with match statements than if conditionals). This allows us to check for errors like PermissionDenied and output the error message accordingly for inaccesible directories/files as regular user. This fixes #9789.

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/chmod/silent. tests/chmod/silent is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/chmod/thru-dangling. tests/chmod/thru-dangling is passing on 'main'. Maybe you have to rebase?

@asder8215
Copy link
Contributor Author

asder8215 commented Dec 24, 2025

I'm not sure if any of the errors on CICD/Build + L10n are the result of the changes I made to this code (it shouldn't affect anything because I just change the implementation of the code from using .exists() to .try_exists() and modified the error messages accordingly to match what GNU outputs). I see the same error for CICD/Build in #9796.

As for the WSL2 error, I ran the sync and df tests locally on my computer and it all passes. Can anyone else confirm anything about these errors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chmod: behavioral divergence from coreutils when the target file is not accessible

1 participant