Lines Matching defs:file
3 // found in the LICENSE file.
46 // We open the file in binary format even if they are text files because
55 // any unusable file yields a result of "false".
83 // any unusable file yields a result of "false".
124 FILE* file = OpenFile(path, "rb");
125 if (!file) {
130 // Hence, the file is read sequentially as opposed to a one-shot read, using
131 // file size as a hint for chunk size if available.
146 chunk_size, file)) > 0) {
161 if (feof(file))
165 read_status = read_status && !ferror(file);
166 CloseFile(file);
200 bool CloseFile(FILE* file) {
201 if (file == nullptr)
203 return fclose(file) == 0;
206 bool TruncateFile(FILE* file) {
207 if (file == nullptr)
209 long current_offset = ftell(file);
213 int fd = _fileno(file);
217 int fd = fileno(file);