From e8fd0b1b3df91d61baa4c94d4b8b41e3d4e164cd Mon Sep 17 00:00:00 2001 From: Dan Macumber Date: Wed, 17 Oct 2018 19:19:17 -0600 Subject: [PATCH] Fixes #3317 --- openstudiocore/src/model/ExternalFile.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/openstudiocore/src/model/ExternalFile.cpp b/openstudiocore/src/model/ExternalFile.cpp index 31eba34964b..96af52f77ee 100644 --- a/openstudiocore/src/model/ExternalFile.cpp +++ b/openstudiocore/src/model/ExternalFile.cpp @@ -218,13 +218,19 @@ ExternalFile::ExternalFile(const Model& model, const std::string &filename) } OS_ASSERT(exists(p)); - path rootDir = workflow.absoluteRootDir(); - path dest = rootDir / p.filename(); + path destDir; + std::vector absoluteFilePaths = workflow.absoluteFilePaths(); + if (absoluteFilePaths.empty()) { + destDir = workflow.absoluteRootDir(); + } else { + destDir = absoluteFilePaths[0]; + } + path dest = destDir / p.filename(); if (exists(dest)) { if (checksum(p) != checksum(dest)){ this->remove(); - LOG_AND_THROW("File \"" << p.filename() << "\" already exists in \"" << rootDir << "\""); + LOG_AND_THROW("File \"" << p.filename() << "\" already exists in \"" << destDir << "\""); } } else{