Skip to content

rm(..., recursive=true) "directory not empty" errors #34700

Open
@stevengj

Description

@stevengj

I was trying to delete my Anaconda installation, which is a huge directory tree (10000+ files), with

using Conda
rm(Conda.ROOTENV, recursive=true)

and I keep getting SystemError .... rmdir: Directory not empty errors. However, if I check that directory, I find that it is indeed empty. Indeed, if I run rm(Conda.ROOTENV, recursive=true) again, then it succeeds in deleting that directory, but then proceeds to give me a similar error with another directory, ad nauseam.

For example (apologies for the screenshot):
image

It looks like there is some kind of race condition in the recursive rm, where it empties the directory, but Windows doesn't realize that the files are gone when it tries to rmdir.

(To reproduce, add the Conda.jl package, make sure it installs Anaconda by running Conda.add("jupyter"), and then try running rm as above. I'm seeming this in a Windows VM, but I saw the same problem on a student's machine earlier today, both with Julia 1.3.1.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorsystem:windowsAffects only Windows

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions