====== setPermissions ====== {#JAPI Joomla.Framework FileSystem JPath::setPermissions #} Changes permissions (using the PHP [[http://www.php.net/chmod|chmod]] function) on files and folders recursively to the specified permissions. ===== Syntax ===== boolean setPermissions ( **$path**, **$filemode**, **$foldermode** ) | **$path** | string | is a string containing the root path to begin changing permissions [without trailing slash]. | | **$filemode** | string | is a string containing an octal representation of the value to change file permissions to. Null indicates that no change will be made to file permissions. This parameter is optional and if omitted will default to '0644'. | | **$foldermode** | string | is a string containing an octal representation of the value to change folder permissions to. Null indicates that no change will be made to folder permissions. This parameter is optional and if omitted will default to '0755'. | ===== Examples ===== jimport( 'joomla.filesystem.path' ); if (JPath::setPermissions( JPATH_ROOT . '/libraries', '222' ) ) { echo "Permissions changed!"; } else { echo "Could not set permissions!"; } might produce: Permissions changed! ---- ~~DISCUSSION~~