ARTS  2.4.0(git:4fb77825)
arts.cc
Go to the documentation of this file.
1 /* Copyright (C) 2003-2012 Stefan Buehler <sbuehler@ltu.se>
2 
3  This program is free software; you can redistribute it and/or modify it
4  under the terms of the GNU General Public License as published by the
5  Free Software Foundation; either version 2, or (at your option) any
6  later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16  USA. */
17 
27 #include "arts.h"
28 #include <unistd.h>
29 #include <cstdlib>
30 #include <stdexcept>
31 #include "file.h"
32 #include "messages.h"
33 
42 void arts_exit(int status) {
43  extern ofstream report_file;
44  extern String out_basename; // Basis for file name
45  ostringstream report_file_ext;
46 
47  report_file_ext << ".rep";
49  add_basedir(out_basename + report_file_ext.str()));
50 
51  exit(status);
52 }
53 
55 
65  ostringstream os;
66 
67  os << m << "\n";
68 
71  extern String out_basename;
72  char *buf = getcwd(nullptr, 0);
73  os << "Detailed report file: " << buf << "/"
74  << add_basedir(out_basename + ".rep") << "\n";
75  free(buf);
76  }
77 
78  os << "Stopping ARTS execution.\n"
79  << "Goodbye.\n";
80  out << os.str();
81 
82  arts_exit(); // No argument means failure.
83 }
out_basename
String out_basename
The basename for the report file and for all other output files.
Definition: messages.cc:42
cleanup_output_file
void cleanup_output_file(ofstream &, const String &)
Closes the file.
Definition: file.cc:136
ArtsOut
Definition: messages.h:87
messages.h
Declarations having to do with the four output streams.
my_basic_string< char >
report_file
ofstream report_file
The report file.
Definition: messages.cc:45
add_basedir
String add_basedir(const String &path)
Definition: file.cc:499
Verbosity::get_screen_verbosity
Index get_screen_verbosity() const
Definition: messages.h:66
file.h
This file contains basic functions to handle ASCII files.
Verbosity::get_file_verbosity
Index get_file_verbosity() const
Definition: messages.h:67
arts_exit
void arts_exit(int status)
This is the exit function of ARTS.
Definition: arts.cc:42
ArtsOut::get_verbosity
const Verbosity & get_verbosity() const
Definition: messages.h:92
arts_exit_with_error_message
void arts_exit_with_error_message(const String &m, ArtsOut &out)
Print error message and exit.
Definition: arts.cc:64
arts.h
The global header file for ARTS.