| 188 | } |
| 189 | |
| 190 | void StdExplorer::EndFileImpl(const FileMode mode) { |
| 191 | switch(mode) { |
| 192 | case FileMode::Read: { |
| 193 | if(this->r_file_obj != nullptr) { |
| 194 | fclose(this->r_file_obj); |
| 195 | this->r_file_obj = nullptr; |
| 196 | } |
| 197 | break; |
| 198 | } |
| 199 | default: { |
| 200 | if(this->w_file_obj != nullptr) { |
| 201 | fclose(this->w_file_obj); |
| 202 | this->w_file_obj = nullptr; |
| 203 | this->DoCommit(); |
| 204 | } |
| 205 | break; |
| 206 | } |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | u64 StdExplorer::ReadFile(const std::string &path, const u64 offset, const u64 size, void *read_buf) { |
| 211 | if(this->r_file_obj != nullptr) { |