X-Git-Url: https://git-public.kairo.at/?p=php-utility-classes.git;a=blobdiff_plain;f=classes%2Frrdstat.php-class;fp=classes%2Frrdstat.php-class;h=0a71f13da11858fc9456fc7e44ed759fd891d90e;hp=9226d564f5f70c2059b340bfdeca81ea39b0e509;hb=5dd242eff6de2d320c75ec83e5f988cd7c769cea;hpb=461e89f00b4707f05734dbf46fcc3c821f8f7c27 diff --git a/classes/rrdstat.php-class b/classes/rrdstat.php-class index 9226d56..0a71f13 100644 --- a/classes/rrdstat.php-class +++ b/classes/rrdstat.php-class @@ -760,7 +760,8 @@ class rrdstat { } $graph_cmd = $this->rrdtool_bin.' graph '.str_replace('*', '\*', $fname.$gOpts.$gDefs.$gGraphs.$addSpecial); - if (!is_writable($fname)) { + if ((file_exists($fname) && !is_writable($fname)) || + (!file_exists($fname) && !is_writable(dirname($fname)))) { trigger_error($this->rrd_file.' - graph file not writable: '.$fname, E_USER_WARNING); return 'command:'.$graph_cmd."\n\n".'unwritable file: '.$fname; }