Index: src/ports/SkOSFile_posix.cpp |
diff --git a/src/ports/SkOSFile_posix.cpp b/src/ports/SkOSFile_posix.cpp |
index 93918b26efcb7cddee7fdf09caab0b522060a670..b5dc4ac09b0fab55113d9a1d93ada0c67fa465f0 100644 |
--- a/src/ports/SkOSFile_posix.cpp |
+++ b/src/ports/SkOSFile_posix.cpp |
@@ -13,6 +13,18 @@ |
#include <sys/mman.h> |
#include <sys/stat.h> |
#include <sys/types.h> |
+#include <unistd.h> |
+ |
+bool sk_exists(const char *path, SkFILE_Flags flags) { |
+ int mode = F_OK; |
+ if (flags & kRead_SkFILE_Flag) { |
+ mode |= R_OK; |
+ } |
+ if (flags & kWrite_SkFILE_Flag) { |
+ mode |= W_OK; |
+ } |
+ return (0 == access(path, mode)); |
+} |
typedef struct { |
dev_t dev; |