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

Unified Diff: src/ports/SkOSFile_win.cpp

Issue 384903002: Add file access modes to sk_exists. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Better comment. Created 6 years, 5 months 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 | « src/ports/SkOSFile_stdio.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkOSFile_win.cpp
diff --git a/src/ports/SkOSFile_win.cpp b/src/ports/SkOSFile_win.cpp
index a0848915ba49e9fd6f8f34b25ba70ca3c003f41a..1430d7f03bf3d1147c2dd4e0be3cd5edfeba4dc5 100644
--- a/src/ports/SkOSFile_win.cpp
+++ b/src/ports/SkOSFile_win.cpp
@@ -13,6 +13,17 @@
#include <stdio.h>
#include <sys/stat.h>
+bool sk_exists(const char *path, SkFILE_Flags flags) {
+ int mode = 0; // existence
+ if (flags & kRead_SkFILE_Flag) {
+ mode |= 4; // read
+ }
+ if (flags & kWrite_SkFILE_Flag) {
+ mode |= 2; // write
+ }
+ return (0 == _access(path, mode));
+}
+
typedef struct {
ULONGLONG fVolume;
ULONGLONG fLsbSize;
« no previous file with comments | « src/ports/SkOSFile_stdio.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698