You are here

public function FrxFile::delete in Forena Reports 7.4

Delete a file from the directory.

Parameters

unknown_type $filename:

Return value

boolean

File

./FrxFile.inc, line 365
FrxFile.inc File toolbox for manipulating files contained tn the report directory.

Class

FrxFile
@file FrxFile.inc File toolbox for manipulating files contained tn the report directory.

Code

public function delete($filename) {
  $path = $this->dir . '/' . $filename;
  $dir = getcwd();
  $do = TRUE;
  if (file_exists($path) && is_writeable($path) && is_writable(dirname($path))) {
    $info = pathinfo($path);
    chdir(dirname($path));
    $do = unlink($info['basename']);
    chdir($dir);
  }
  return $do;
}