Lines Matching defs:file
48 void PrintF(FILE* out, const char* format, ...) {
65 void Flush(FILE* out) {
122 char* ReadCharsFromFile(FILE* file,
127 if (file == NULL || fseek(file, 0, SEEK_END) != 0) {
129 OS::PrintError("Cannot read from file %s.\n", filename);
134 // Get the size of the file and rewind it.
135 *size = ftell(file);
136 rewind(file);
139 for (int i = 0; i < *size && feof(file) == 0;) {
140 int read = static_cast<int>(fread(&result[i], 1, *size - i, file));
141 if (read != (*size - i) && ferror(file) != 0) {
142 fclose(file);
156 FILE* file = OS::FOpen(filename, "rb");
157 char* result = ReadCharsFromFile(file, size, extra_space, verbose, filename);
158 if (file != NULL) fclose(file);
191 Vector<const char> ReadFile(FILE* file,
195 char* result = ReadCharsFromFile(file, &size, 1, verbose, "");
200 int WriteCharsToFile(const char* str, int size, FILE* f) {
218 FILE* f = OS::FOpen(filename, "ab");
221 OS::PrintError("Cannot open file %s for writing.\n", filename);
235 FILE* f = OS::FOpen(filename, "wb");
238 OS::PrintError("Cannot open file %s for writing.\n", filename);