Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2115)

Unified Diff: base/files/file_util.cc

Issue 1446363003: Deleted OS_WIN and all Windows specific files from base. (Closed) Base URL: https://github.com/domokit/mojo.git@base_tests
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/files/file_util.h ('k') | base/files/file_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_util.cc
diff --git a/base/files/file_util.cc b/base/files/file_util.cc
index 4b6b8886d8ad5d8bc0fd4855b10c97db52420d2e..44c42bf16a90e5f1b075f65ad75dc2f78224c1cd 100644
--- a/base/files/file_util.cc
+++ b/base/files/file_util.cc
@@ -4,9 +4,6 @@
#include "base/files/file_util.h"
-#if defined(OS_WIN)
-#include <io.h>
-#endif
#include <stdio.h>
#include <fstream>
@@ -198,12 +195,6 @@ bool TouchFile(const FilePath& path,
const Time& last_modified) {
int flags = File::FLAG_OPEN | File::FLAG_WRITE_ATTRIBUTES;
-#if defined(OS_WIN)
- // On Windows, FILE_FLAG_BACKUP_SEMANTICS is needed to open a directory.
- if (DirectoryExists(path))
- flags |= File::FLAG_BACKUP_SEMANTICS;
-#endif // OS_WIN
-
File file(path, flags);
if (!file.IsValid())
return false;
@@ -225,15 +216,9 @@ bool TruncateFile(FILE* file) {
long current_offset = ftell(file);
if (current_offset == -1)
return false;
-#if defined(OS_WIN)
- int fd = _fileno(file);
- if (_chsize(fd, current_offset) != 0)
- return false;
-#else
int fd = fileno(file);
if (ftruncate(fd, current_offset) != 0)
return false;
-#endif
return true;
}
« no previous file with comments | « base/files/file_util.h ('k') | base/files/file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698