Home | History | Annotate | Download | only in base

Lines Matching defs:file

3 // found in the LICENSE file.
70 HANDLE file = CreateFile(name.value().c_str(), access, sharing, NULL,
73 if (created && (INVALID_HANDLE_VALUE != file)) {
81 if (file != kInvalidPlatformFileValue)
104 return file;
107 bool ClosePlatformFile(PlatformFile file) {
109 return (CloseHandle(file) != 0);
112 int ReadPlatformFile(PlatformFile file, int64 offset, char* data, int size) {
114 if (file == kInvalidPlatformFileValue)
125 if (::ReadFile(file, data, size, &bytes_read, &overlapped) != 0)
133 int WritePlatformFile(PlatformFile file, int64 offset,
136 if (file == kInvalidPlatformFileValue)
147 if (::WriteFile(file, data, size, &bytes_written, &overlapped) != 0)
153 bool TruncatePlatformFile(PlatformFile file, int64 length) {
155 if (file == kInvalidPlatformFileValue)
158 // Get the current file pointer.
162 if (::SetFilePointerEx(file, zero, &file_pointer, FILE_CURRENT) == 0)
167 // If length > file size, SetFilePointerEx() should extend the file
168 // with zeroes on all Windows standard file systems (NTFS, FATxx).
169 if (!::SetFilePointerEx(file, length_li, NULL, FILE_BEGIN))
172 // Set the new file length and move the file pointer to its old position.
173 // This is consistent with ftruncate()'s behavior, even when the file
174 // pointer points to a location beyond the end of the file.
175 return ((::SetEndOfFile(file) != 0) &&
176 (::SetFilePointerEx(file, file_pointer, NULL, FILE_BEGIN) != 0));
179 bool FlushPlatformFile(PlatformFile file) {
181 return ((file != kInvalidPlatformFileValue) && ::FlushFileBuffers(file));
184 bool TouchPlatformFile(PlatformFile file, const base::Time& last_access_time,
187 if (file == kInvalidPlatformFileValue)
192 return (::SetFileTime(file, NULL, &last_access_filetime,
196 bool GetPlatformFileInfo(PlatformFile file, PlatformFileInfo* info) {
202 if (GetFileInformationByHandle(file, &file_info) == 0)