1
0
Fork 0

don't scan the specified directory recursively (#10201)

This commit is contained in:
Wilfried Goesgens 2019-10-09 16:14:18 +02:00 committed by Jan
parent 8a1faabcb5
commit 9444bcf650
1 changed files with 2 additions and 6 deletions

View File

@ -245,12 +245,8 @@ ManagedDirectory::ManagedDirectory(application_features::ApplicationServer& serv
return; return;
} }
std::vector<std::string> files(TRI_FullTreeDirectory(_path.c_str())); std::vector<std::string> files(TRI_FilesDirectory(_path.c_str()));
bool isEmpty = (files.size() <= 1); if (!files.empty()) {
// TODO: TRI_FullTreeDirectory always returns at least one element ("")
// even if directory is empty?
if (!isEmpty) {
// directory exists, has files, and we aren't allowed to overwrite // directory exists, has files, and we aren't allowed to overwrite
if (requireEmpty) { if (requireEmpty) {
_status.reset(TRI_ERROR_CANNOT_OVERWRITE_FILE, _status.reset(TRI_ERROR_CANNOT_OVERWRITE_FILE,