Created
February 26, 2014 03:54
-
-
Save nexocentric/9223248 to your computer and use it in GitHub Desktop.
functions for checking directory permissions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkFilePermissions($filename) | |
{ | |
if(!file_exists($filename)) { | |
return "filename does not file_exists"; | |
} | |
if(!is_file($filename)) { | |
return "filename does not is_file"; | |
} | |
if(!is_readable($filename)) { | |
return "filename does not is_readable"; | |
} | |
if(!is_writable($filename)) { | |
return "filename does not is_writable"; | |
} | |
return; | |
} | |
function checkDirectoryPermissions($directory) | |
{ | |
if(!file_exists($directory)) { | |
return "directory does not file_exists"; | |
} | |
if(!is_dir($directory)) { | |
return "directory does not is_dir"; | |
} | |
if(!is_readable($directory)) { | |
return "directory does not is_readable"; | |
} | |
if(!is_writable($directory)) { | |
return "directory does not is_writable"; | |
} | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment