Index: base/file_util_win.cc |
diff --git a/base/file_util_win.cc b/base/file_util_win.cc |
index 9133e7b5296ba6b7244e6b30d761adfee3a9d0b4..9def1a5dfdcdc527a3ec973f67d7482dd37edf78 100644 |
--- a/base/file_util_win.cc |
+++ b/base/file_util_win.cc |
@@ -216,6 +216,19 @@ bool PathExists(const FilePath& path) { |
return (GetFileAttributes(path.value().c_str()) != INVALID_FILE_ATTRIBUTES); |
} |
+bool PathIsReadable(const FilePath& path) { |
+ HANDLE dir = |
+ CreateFile(path.value().c_str(), FILE_READ_DATA, |
wtc
2010/01/12 19:51:02
I'm surprised that we have to test if a file is re
agl
2010/01/25 14:14:09
Ah, _access looks good. I've switched to using tha
|
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, |
+ NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); |
+ |
+ if (dir == INVALID_HANDLE_VALUE) |
+ return false; |
+ |
+ CloseHandle(dir); |
+ return true; |
+} |
+ |
bool PathIsWritable(const FilePath& path) { |
HANDLE dir = |
CreateFile(path.value().c_str(), FILE_ADD_FILE, |