I encountered an interview question today. Make sure chmod is executed successfully. Please help me solve it!
为情所困2017-05-24 11:36:33
$file = 'path/to/file';
$mode = 0755;
if(@chmod($file,$mode) === false)
throw new \RuntimeException("$file can not change mode to $mode");