WP_Filesystem_Direct::getchmodpublicWP 2.5.0

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

Метод класса: WP_Filesystem_Direct{}

Хуков нет.

Возвращает

Строку. Mode of the file (the last 3 digits), or the string "0" on failure.

Использование

$WP_Filesystem_Direct = new WP_Filesystem_Direct();
$WP_Filesystem_Direct->getchmod( $file );
$file(строка) (обязательный)
Path to the file.

Список изменений

С версии 2.5.0 Введена.

Код WP_Filesystem_Direct::getchmod() WP 7.0

public function getchmod( $file ) {
	$perms = @fileperms( $file );
	if ( false === $perms ) {
		return '0';
	}

	return substr( decoct( $perms ), -3 );
}