Skip to content

Commit

Permalink
[ntupleutil] exporter: error out if the output file is not writable
Browse files Browse the repository at this point in the history
  • Loading branch information
silverweed committed Jan 17, 2025
1 parent 03c425a commit 66d814b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tree/ntupleutil/v7/src/RNTupleExporter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<const char *>(pageBuf), pageBufSize);

res.fExportedFileNames.push_back(outFileName);
Expand Down

0 comments on commit 66d814b

Please sign in to comment.