removeDirectoryRecursive: permission denied (Access is denied.) Windows #59
Thanks for your investigation on the original issue (got here from stack)!
To summarize (correct me if I'm wrong):
*nix and Windows behave differently in that on *nix the permission to delete is determined by the write-bit on the parent directory, whereas on Windows the permission to delete is determined by the attributes of the file itself. I don't believe there's a way to make this "consistent" without doing a lot of ugly hacks.
I agree that the failure to delete read-only files is kind of annoying and probably not what the user expects.
However, I'm somewhat hesitant on changing the behavior of a core function such as
I could add something like
I agree a bit with your hesitation; I'd propose to add mention of this issue then for
Would you be open to changing
I suppose that at least any build tool removing directories it created (cabal-install, Shake, ...) would need the same behavior, so I think this would be useful in a common package rather than inside Stack.
Since you mention the Python standard library, I found its shutil.rmtree function: they provide a callback for handling errors on a single deletion, which could be used to change permissions and allow to resume operations.