bjornbjorn / snippetssync.ee2_addon

Save snippets as files during development
http://wedoaddons.com
21 stars 8 forks source link

Permissions check and change error #6

Closed joshuabaker closed 9 years ago

joshuabaker commented 12 years ago

octdec() method is required as octals and decimals are different. It may also be wise to leave permissions as they are if they don’t need to be changed.

joshuabaker commented 12 years ago

Slight, further adjustment...

if ( octdec(substr(sprintf('%o', fileperms( $dir )), -4)) < $perms )
{
    return @chmod( $dir , $perms );
}