njuhugn / leveldb

Automatically exported from code.google.com/p/leveldb
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

DestroyDB() doesn't delete empty directories #209

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by jsbell@chromium.org on 11 Oct 2013 at 6:17