25 #include <vigra/error.hxx>
43 file = std::fopen(path, mode);
45 std::string msg(
"Unable to open file '");
48 vigra_precondition(0, msg.c_str());
56 if (std::fclose(
file)) {
62 msg =
"Bad file descriptor.";
65 msg =
"An I/O error occurred while closing the file.";
68 msg =
"An error ocured while closing the file.";
71 vigra_postcondition(0, msg.c_str());
FileRAII(const char *path, const char *mode)
Open the specified file.
FileRAII & operator=(const FileRAII &)
Class used for opening files.