aboutsummaryrefslogtreecommitdiff
path: root/ixslt.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ixslt.cc')
-rw-r--r--ixslt.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/ixslt.cc b/ixslt.cc
index b1671b3..abc7e1a 100644
--- a/ixslt.cc
+++ b/ixslt.cc
@@ -1,5 +1,6 @@
#include "boost/optional.hpp"
#include "boost/program_options.hpp"
+#include <boost/filesystem/fstream.hpp>
#include <string>
#include <vector>
@@ -117,9 +118,15 @@ bool process(const boost::program_options::variables_map& variables) {
try {
if ( variables.count("target") ) {
- transformation->generate(
+ boost::filesystem::ofstream file(
variables["target"].as<std::string>()
);
+
+ if ( file.is_open() ) {
+ transformation->generate(file);
+ } else {
+ return false;
+ }
} else {
transformation->generate(std::cout);
}