boolean Storage::read(BinaryData& data, ConstString path) { String fullpath = root; fullpath << path; FILE* handle = fopen(fullpath.c_str(), "rb"); if(handle == 0){ logError << "cant fopen file = \"" << path << "\""; return false; } fseek(handle, 0, SEEK_END); uint64 size = ftell(handle); fseek(handle, 0, SEEK_SET); data.resize(size); uint64 readed = fread(data.first(), 1, data.byteSize(), handle); fclose(handle); if(readed == data.byteSize()) return true; logError << "read " << data.byteSize() <<"bytes from file = \"" << fullpath << "\""; return false; }