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;
|
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,
|
||||||
|
|
Loading…
Reference in New Issue