aboutsummaryrefslogtreecommitdiffstats
path: root/src/fs
diff options
context:
space:
mode:
authorDenis Krjuchkov <denis@crazydev.net>2013-12-05 14:39:19 +0600
committerDenis Krjuchkov <denis@crazydev.net>2013-12-05 15:05:01 +0600
commit06d71696745388c5663fdd676ffbfd783459f6fc (patch)
tree4a54c727760751381812554f0a99d7ad9fe7eb79 /src/fs
parent8bf164093296361c0936a9372fa199daabe4f6db (diff)
downloadmpd-06d71696745388c5663fdd676ffbfd783459f6fc.tar.gz
mpd-06d71696745388c5663fdd676ffbfd783459f6fc.tar.xz
mpd-06d71696745388c5663fdd676ffbfd783459f6fc.zip
fs/FileSystem.hxx: add CheckAccess without mode parameter
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/FileSystem.hxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/fs/FileSystem.hxx b/src/fs/FileSystem.hxx
index b4dd01cd3..66fe77d31 100644
--- a/src/fs/FileSystem.hxx
+++ b/src/fs/FileSystem.hxx
@@ -149,6 +149,20 @@ CheckAccess(Path path, int mode)
}
/**
+ * Checks is specified path exists and accessible.
+ */
+static inline bool
+CheckAccess(Path path)
+{
+#ifdef WIN32
+ struct stat buf;
+ return StatFile(path, buf);
+#else
+ return CheckAccess(path, F_OK);
+#endif
+}
+
+/**
* Checks if #Path exists and is a regular file.
*/
static inline bool