Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Try to mitigate Windows AccessDeniedException when using IO.deleteRecursive #3834

Merged
merged 2 commits into from Mar 11, 2024

Conversation

WojciechMazur
Copy link
Contributor

Best effort fix to issue found in Bloop builds for Scala Native 0.5.: https://github.com/scalacenter/bloop/actions/runs/8224055636/job/22487426436#step:4:1004

Related https://stackoverflow.com/questions/64090643/java-nio-file-accessdeniedexception-while-trying-to-delete-a-renamed-directoryu (see comments)

Windows has some unusual file locking behaviors. Deleting files shortly after using them is rarely possible to do quickly or expediently using Java on Windows, as the file locking will get in your way. Best advice is to ensure that all resources for that File/Path/Streams/etc are all closed properly before attempting to delete that file. But even so, that file can be seen by Windows as still locked and not possible to be deleted (yet)

Co-authored-by: João Costa <jdpc557@gmail.com>
@WojciechMazur WojciechMazur merged commit 8f1e7d0 into scala-native:main Mar 11, 2024
61 checks passed
@WojciechMazur WojciechMazur deleted the fix/delete-recursive branch March 11, 2024 15:48
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.

None yet

2 participants