- if (!is_writeable($this->rrd_file)) {
- if (!file_exists($this->rrd_file)) {
- if (touch($this->rrd_file)) { $this->create(); }
- else { trigger_error('RRD file can not be created', E_USER_WARNING); }
+ if (!is_null($this->rrd_file)) {
+ if (!is_writeable($this->rrd_file)) {
+ if (!file_exists($this->rrd_file)) {
+ if (touch($this->rrd_file)) { $this->create(); }
+ else { trigger_error('RRD file can not be created', E_USER_WARNING); }
+ }
+ else {
+ if (is_readable($this->rrd_file)) { $this->status = 'readonly'; }
+ else { trigger_error('RRD file is not readable', E_USER_WARNING); }
+ }