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

Issues deleting directories. Error: "Directory not empty" #97

Open
nicoburns opened this issue Jul 26, 2023 · 4 comments
Open

Issues deleting directories. Error: "Directory not empty" #97

nicoburns opened this issue Jul 26, 2023 · 4 comments

Comments

@nicoburns
Copy link

Kondo is successfully detecting my cargo projects. And it is successfully deleting some of them. However, some of them are erroring out with error removing directory "/path/to/directory": Os { code: 66, kind: DirectoryNotEmpty, message: "Directory not empty" }. The directory is always the top-level target directory. And it seems that kondo is trying to delete this directory before it is deleted the entire contents.

For context, some of these directories are very large (the largest being ~170GB). Not sure if that could be part of the cause.

@tbillington
Copy link
Owner

Thanks for reporting this!

Do either cargo clean or rm have the same issue? Also do you happen to be on Windows by chance?

I've also encountered issues while I had rust-analyzer active, it would start re-populating the target directory halfway through the delete.

@tompscanlan
Copy link

Another thought, is it possible there are nested projects? for example: /home/user/my-project is a maven project that contains a subdir with cargo tool in it?

Looks like that could end up with the results you're having.

This was referenced Aug 26, 2023
@tbillington
Copy link
Owner

@tompscanlan did you encounter this too? Is there any info you could share about your system if so :)

@tompscanlan
Copy link

I hit the same error msg, but not certain it was the same reason. I was fooling around making a mess for kondo to clean up on a windows11 machine in a wsl ubuntu image.

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

No branches or pull requests

3 participants