26 "Error while reading " << filename <<
": The file does not exist or is not readable.");
32 if (stat(filename, &(this->st)) != 0) {
34 if (stat64(filename, &(this->st)) != 0) {
36 STORM_LOG_THROW(
false, storm::exceptions::FileIoException,
"Error in stat(" << filename <<
"): Probably, this file does not exist.");
38 this->file = open(filename, O_RDONLY);
40 STORM_LOG_THROW(this->file >= 0, storm::exceptions::FileIoException,
"Error in open(" << filename <<
"): Probably, we may not read this file.");
42 this->data =
static_cast<char*
>(mmap(NULL, this->st.st_size, PROT_READ, MAP_PRIVATE, this->file, 0));
43 if (this->data == MAP_FAILED) {
45 STORM_LOG_ERROR(
"Error in mmap(" << filename <<
"): " << std::strerror(errno));
46 throw exceptions::FileIoException() <<
"MappedFile Error in mmap(): " << std::strerror(errno);
48 this->dataEnd = this->data + this->st.st_size;