summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-07-28 13:44:31 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2000-07-28 13:44:31 +0200
commit92096e097a5cb6b90fb982d90b16012682d67ccf (patch)
tree132e337d98f7dbfec9d81c234d32171abd9d3fdc /tools.c
parent7ac97639da8b6428e2a17464bddea0280f032321 (diff)
downloadvdr-92096e097a5cb6b90fb982d90b16012682d67ccf.tar.gz
vdr-92096e097a5cb6b90fb982d90b16012682d67ccf.tar.bz2
Added command line option '-v'
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index 998d91b3..88acd333 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 1.10 2000/07/23 13:16:54 kls Exp $
+ * $Id: tools.c 1.11 2000/07/28 13:22:10 kls Exp $
*/
#define _GNU_SOURCE
@@ -145,6 +145,24 @@ bool isnumber(const char *s)
return true;
}
+bool DirectoryOk(const char *DirName)
+{
+ struct stat ds;
+ if (stat(DirName, &ds) == 0) {
+ if (S_ISDIR(ds.st_mode)) {
+ if (access(DirName, R_OK | W_OK | X_OK) == 0)
+ return true;
+ else
+ esyslog(LOG_ERR, "ERROR: can't access %s", DirName);
+ }
+ else
+ esyslog(LOG_ERR, "ERROR: %s is not a directory", DirName);
+ }
+ else
+ LOG_ERROR_STR(DirName);
+ return false;
+}
+
bool MakeDirs(const char *FileName, bool IsDirectory)
{
bool result = true;