22 #include "IOException.hpp"
28 namespace FotoSHOCKcore {
44 file = std::fopen (path, mode);
46 std::string msg(
"Unable to open the file ");
48 msg +=
" with mode: ";
61 if (std::fclose (file)) {
66 msg =
"Bad file descriptor.";
69 msg =
"An I/O error occurred while closing the file.";
72 msg =
"An error ocured while closing the file.";
75 throw IOException(msg.c_str(), __FILE__, __LINE__);
93 if (std::fclose (file)) {
97 std::fprintf(stderr,
"Bad file descriptor.");
100 std::fprintf(stderr,
"An I/O error occurred while closing the file.");
103 std::fprintf(stderr,
"An error ocured while closing the file.");