public function checkPathArg($name)
{
$filepath = '';
if ($name[0] == '/') {
$filepath = $name;
} else {
$filepath = $this->cwd . '/' . $name;
}
if (!file_exists($filepath)) {
cli_error("File '{$filepath}' does not exist");
}
if (!is_readable($filepath)) {
cli_error("File '{$filepath}' is not readable");
}
return $filepath;
}