public function FileBase::delete in Forena Reports 7.5
Same name and namespace in other branches
- 8 src/File/FileBaseOld.php \Drupal\forena\File\FileBase::delete()
Delete a file from the directory.
Parameters
unknown_type $filename:
Return value
boolean
File
- src/
File/ FileBase.php, line 367 - FileBase.inc File toolbox for manipulating files contained tn the report directory.
Class
Namespace
Drupal\forena\FileCode
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;
}