diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteASCIIDataFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteASCIIDataFilter.cpp index aacf501b72..0bcaec1fb1 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteASCIIDataFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteASCIIDataFilter.cpp @@ -24,6 +24,7 @@ namespace { // Error Code constants constexpr nx::core::int32 k_UnmatchingTupleCountError = -51001; +constexpr nx::core::int32 k_NoArraySelections = -51002; } // namespace namespace nx::core @@ -118,6 +119,10 @@ IFilter::PreflightResult WriteASCIIDataFilter::preflightImpl(const DataStructure if(static_cast(pOutputStyleValue) == WriteASCIIDataFilter::OutputStyle::SingleFile) { auto pSelectedDataArrayPathsValue = filterArgs.value(k_SelectedDataArrayPaths_Key); + if(pSelectedDataArrayPathsValue.empty()) + { + return MakePreflightErrorResult(k_NoArraySelections, "At least 1 data array must be selected"); + } if(!CheckArraysHaveSameTupleCount(dataStructure, pSelectedDataArrayPathsValue)) { diff --git a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteDREAM3DFilter.cpp b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteDREAM3DFilter.cpp index 2786e93d0a..3cedf6c845 100644 --- a/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteDREAM3DFilter.cpp +++ b/src/Plugins/SimplnxCore/src/SimplnxCore/Filters/WriteDREAM3DFilter.cpp @@ -57,9 +57,9 @@ Parameters WriteDREAM3DFilter::parameters() const Parameters params; params.insertSeparator(Parameters::Separator{"Input Parameters"}); - params.insert(std::make_unique(k_ExportFilePath, "Export File Path", "The file path the DataStructure should be written to as an HDF5 file.", "", - FileSystemPathParameter::ExtensionsType{".dream3d"}, FileSystemPathParameter::PathType::OutputFile)); - params.insert(std::make_unique(k_WriteXdmf, "Write Xdmf File", "Whether or not to write the data out an xdmf file", true)); + params.insert(std::make_unique(k_ExportFilePath, "Output File Path", "The file path the DataStructure should be written to as an HDF5 file.", "Untitled.dream3d", + FileSystemPathParameter::ExtensionsType{".dream3d"}, FileSystemPathParameter::PathType::OutputFile, false)); + params.insert(std::make_unique(k_WriteXdmf, "Write Xdmf File", "Whether or not to write the data out an XDMF file", true)); return params; } diff --git a/src/simplnx/Parameters/FileSystemPathParameter.cpp b/src/simplnx/Parameters/FileSystemPathParameter.cpp index 8ddbbaa4c9..0b490498c9 100644 --- a/src/simplnx/Parameters/FileSystemPathParameter.cpp +++ b/src/simplnx/Parameters/FileSystemPathParameter.cpp @@ -52,6 +52,11 @@ Result<> ValidateInputDir(const FileSystemPathParameter::ValueType& path) //----------------------------------------------------------------------------- Result<> ValidateOutputFile(const FileSystemPathParameter::ValueType& path) { + if(fs::exists(path) && fs::is_directory(path)) + { + return MakeErrorResult(-8, fmt::format("File System Path '{}' exists AND is a directory. The Parameter is set to save a file.", path.string())); + } + auto result = FileUtilities::ValidateDirectoryWritePermission(path, true); if(result.invalid()) {