mirror of https://gitee.com/bigwinds/arangodb
don't scan the specified directory recursively (#10201)
This commit is contained in:
parent
8a1faabcb5
commit
9444bcf650
|
@ -245,12 +245,8 @@ ManagedDirectory::ManagedDirectory(application_features::ApplicationServer& serv
|
|||
return;
|
||||
}
|
||||
|
||||
std::vector<std::string> files(TRI_FullTreeDirectory(_path.c_str()));
|
||||
bool isEmpty = (files.size() <= 1);
|
||||
// TODO: TRI_FullTreeDirectory always returns at least one element ("")
|
||||
// even if directory is empty?
|
||||
|
||||
if (!isEmpty) {
|
||||
std::vector<std::string> files(TRI_FilesDirectory(_path.c_str()));
|
||||
if (!files.empty()) {
|
||||
// directory exists, has files, and we aren't allowed to overwrite
|
||||
if (requireEmpty) {
|
||||
_status.reset(TRI_ERROR_CANNOT_OVERWRITE_FILE,
|
||||
|
|
Loading…
Reference in New Issue