diff options
Diffstat (limited to 'backends/fs/posix/posix-fs.cpp')
-rw-r--r-- | backends/fs/posix/posix-fs.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp index b0c888966f..9d2416a9bc 100644 --- a/backends/fs/posix/posix-fs.cpp +++ b/backends/fs/posix/posix-fs.cpp @@ -38,6 +38,9 @@ #include <sys/param.h> #include <sys/stat.h> +#ifdef MACOSX +#include <sys/types.h> +#endif #ifdef PSP2 #include "backends/fs/psp2/psp2-dirent.h" #define mkdir sceIoMkdir @@ -47,6 +50,7 @@ #include <stdio.h> #include <errno.h> #include <fcntl.h> +#include <unistd.h> #ifdef __OS2__ #define INCL_DOS @@ -54,6 +58,18 @@ #endif +bool POSIXFilesystemNode::exists() const { + return access(_path.c_str(), F_OK) == 0; +} + +bool POSIXFilesystemNode::isReadable() const { + return access(_path.c_str(), R_OK) == 0; +} + +bool POSIXFilesystemNode::isWritable() const { + return access(_path.c_str(), W_OK) == 0; +} + void POSIXFilesystemNode::setFlags() { struct stat st; |