diff --git a/tree/ntupleutil/v7/src/RNTupleExporter.cxx b/tree/ntupleutil/v7/src/RNTupleExporter.cxx index 075ee32c53cb3..0969a7c7a94d9 100644 --- a/tree/ntupleutil/v7/src/RNTupleExporter.cxx +++ b/tree/ntupleutil/v7/src/RNTupleExporter.cxx @@ -166,6 +166,10 @@ RNTupleExporter::RPagesResult RNTupleExporter::ExportPages(RPageSource &source, << "_elems_" << pageInfo.fNElements << "_comp_" << *colRange.fCompressionSettings << ".page"; const auto outFileName = ss.str(); std::ofstream outFile{outFileName, std::ios_base::binary}; + if (!outFile) + throw ROOT::RException( + R__FAIL(std::string("output path ") + options.fOutputPath + " does not exist or is not writable!")); + outFile.write(reinterpret_cast(pageBuf), pageBufSize); res.fExportedFileNames.push_back(outFileName);