Lines Matching refs:file_descriptor
12 FILE* file_descriptor = fopen(filename.c_str(), "wb"); in WriteStringToFileOrDie() local
13 if (!file_descriptor) { in WriteStringToFileOrDie()
16 fwrite(data.c_str(), 1, data.size(), file_descriptor); in WriteStringToFileOrDie()
17 fclose(file_descriptor); in WriteStringToFileOrDie()
21 FILE* file_descriptor = fopen(filename.c_str(), "r"); in ReadFileToStringOrDie() local
23 if (!file_descriptor) { in ReadFileToStringOrDie()
28 fseek(file_descriptor, 0L, SEEK_END); in ReadFileToStringOrDie()
29 int num_bytes = ftell(file_descriptor); in ReadFileToStringOrDie()
33 fseek(file_descriptor, 0L, SEEK_SET); in ReadFileToStringOrDie()
35 fread(&((*data)[0]), sizeof((*data)[0]), num_bytes, file_descriptor); in ReadFileToStringOrDie()
41 fclose(file_descriptor); in ReadFileToStringOrDie()