* Opens the FAT resource */
| 26 | * Opens the FAT resource |
| 27 | */ |
| 28 | FatSystem::FatSystem(string filename_, unsigned long long globalOffset_, OutputFormatType outputFormat_) |
| 29 | : strange(0), |
| 30 | filename(filename_), |
| 31 | globalOffset(globalOffset_), |
| 32 | totalSize(-1), |
| 33 | listDeleted(false), |
| 34 | statsComputed(false), |
| 35 | freeClusters(0), |
| 36 | cacheEnabled(false), |
| 37 | type(FAT32), |
| 38 | rootEntries(0) |
| 39 | { |
| 40 | this->_outputFormat = outputFormat_; |
| 41 | fd = open(filename.c_str(), O_RDONLY|O_LARGEFILE); |
| 42 | writeMode = false; |
| 43 | |
| 44 | if (fd < 0) { |
| 45 | ostringstream oss; |
| 46 | oss << "! Unable to open the input file: " << filename << " for reading"; |
| 47 | |
| 48 | throw oss.str(); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | void FatSystem::enableCache() |
| 53 | { |
nothing calls this directly
no outgoing calls
no test coverage detected