You appear to be a bot. Output may be restricted
Description
Return the current file mode permissions then chmod if set
Usage
$integer = bw_chmod( $file, $chmod );
Parameters
- $file
- ( string ) required –
- $chmod
- ( integer ) optional – decimal integer for the new file mode
Returns
integer decimal integer for the original file mode Note: To print the returned value as octal use decoct()Source
File name: oik-bwtrace/admin/oik-replace.incLines:
1 to 10 of 10
function bw_chmod( $file, $chmod=null ) { $fileperms = fileperms( $file ); $fp = $fileperms & 0007777; if ( $chmod ) { //echo "changing $file to $chmod " . decoct( $chmod ) . PHP_EOL; chmod( $file, decoct($chmod) ); } //echo "was $file " . decoct( $fp) . PHP_EOL; return( octdec($fp) ); }View on GitHub View on Trac