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

DestroyDB() doesn't delete empty directories #215

Closed
cmumford opened this issue Sep 9, 2014 · 0 comments
Closed

DestroyDB() doesn't delete empty directories #215

cmumford opened this issue Sep 9, 2014 · 0 comments
Assignees

Comments

@cmumford
Copy link
Contributor

cmumford commented Sep 9, 2014

Original issue 209 created by jsbell@chromium.org on 2013-10-11T18:17:28.000Z:

leveldb::DestroyDB() exits early if the target directory doesn't exist or is empty. In this case it does not delete the directory itself. If the target directory is non-empty, then after deleting the contents the function deletes the directory itself. This seems inconsistent.

A trivial fix appears to be to insert env->DeleteDir(dbname); just before the early exit.

@cmumford cmumford self-assigned this Sep 9, 2014
@cmumford cmumford removed their assignment Jan 16, 2016
@cmumford cmumford self-assigned this Oct 16, 2017
@pwnall pwnall closed this as completed in 0509414 Nov 3, 2017
Alexhuszagh pushed a commit to Alexhuszagh/leveldb that referenced this issue Nov 8, 2017
Env's that filtered out dot files ("." and "..") would return an
empty vector of children causing DestroyDB to do nothing. This fixes
google#215

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172501335
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant