WP_Filesystem_Direct::getchmod() – Gets the permissions of the specified file or filepath in their octal format.

You appear to be a bot. Output may be restricted

Description

Gets the permissions of the specified file or filepath in their octal format.

FIXME does not handle errors in fileperms()

Usage

$string = WP_Filesystem_Direct::getchmod( $file );

Parameters

$file
( string ) required – Path to the file.

Returns

string Mode of the file (the last 3 digits).

Source

File name: wordpress/wp-admin/includes/class-wp-filesystem-direct.php
Lines:

1 to 3 of 3
  public function getchmod( $file ) {
    return substr( decoct( @fileperms( $file ) ), -3 );
  }
 

 View on GitHub View on Trac