/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2012 University of Bonn. All rights reserved. * Please see the LICENSE file or "Copyright notice" in builder.cpp for details. */ /* * \file mpqc.cpp * * This file is for a stand-in for mpqc that just prints an output file (.out) which * is assumed to be present under the same path as the given input file (.in). * * Created on: Apr 19, 2012 * Author: heber */ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "CodePatterns/MemDebug.hpp" #include #include #include int main(int argc, char **argv) { // check arguments if (argc < 2) { std::cout << argv[0] << ": error: no molecule given" << std::endl; return 134; } // read given file, first line contains output file std::ifstream infile(argv[1]); std::string outfilename; getline(infile, outfilename); // try to open file std::ifstream file(outfilename.c_str()); if (file.good()) { // print file's contents std::string line; while (getline(file,line)) std::cout << line << std::endl; return 0; } else { std::cout << argv[0] << ": error: no output file found" << std::endl; return 134; } }