summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2008-10-15 23:35:23 +0200
committerAndreas Unterkircher <unki@netshadow.at>2008-10-15 21:47:23 +0200
commit79362554f81c7d1779b1755ca715874a691392f0 (patch)
treedb8fc75f940557d2853cebeeb48e3384a160499e
parent37d9c8bf7eb7c4244f93d9ed780333ec1fa4ae86 (diff)
check if F-Spot database file exists and is readable
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
-rw-r--r--phpfspot.class.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index 92c0fd2..9b24d3b 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -141,6 +141,12 @@ class PHPFSPOT {
/******* Opening F-Spot's sqlite database *********/
+ /* Check if database file exists and is readable */
+ if(!file_exists($this->cfg->fspot_db) || !is_readable($this->cfg->fspot_db)) {
+ print "Error: ". $this->cfg->fspot_db ." does not exist or is not readable for user ". $this->getuid() .".\n";
+ exit(1);
+ }
+
/* Check if database file is writeable */
if(!is_writeable($this->cfg->fspot_db)) {
print "Error: ". $this->cfg->fspot_db ." is not writeable for user ". $this->getuid() .".\n";