[llvm] [llvm][Support][Windows] Avoid crash calling remove_directories() (PR #118677)

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 11 15:56:59 PST 2024


rnk wrote:

> Manually performing the DFS and doing the removal would require that we properly handle long paths and that we handle some of the permission work (e.g. IIRC backup semantics may sometimes be required to remove the file). Even `del` in `cmd` has trouble with long paths, so we should be careful to not re-invent the removal logic if not absolutely necessary. I expect that @rnk would also have some thoughts here.

We should already handle long paths, I think I would be more worried about "backup semantics" and other cases where we empty a directory, but then cannot remove the parent directory because it is not yet empty. Those are the kinds of cases where you just want to ask some Windows system DLL to do it for you.

https://github.com/llvm/llvm-project/pull/118677


More information about the llvm-commits mailing list