mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-27 14:28:56 +00:00

# Translators please wait 24 hours before updating... I'm doing most of them too git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@260761 c90b9560-bf6c-de11-be94-00142212c4b1
127 lines
3.2 KiB
XML
127 lines
3.2 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.4 $ -->
|
|
<refentry xml:id="function.rar-getattr" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>Rar::getAttr</refname>
|
|
<refpurpose>Get attributes of the entry</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<classsynopsis>
|
|
<ooclass><classname>Rar</classname></ooclass>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>getAttr</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
</classsynopsis>
|
|
<para>
|
|
<function>Rar::getAttr</function> returns attributes of the archive
|
|
entry.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Returns the attributes or &false; on error.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>Rar::getAttr</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$rar_file = rar_open('example.rar') or die("Can't open Rar archive");
|
|
|
|
$entry = rar_entry_get($rar_file, 'dir/in/the/archive') or die("Can't find such entry");
|
|
|
|
$host_os = $entry->getHostOs();
|
|
$attr = $entry->getAttr();
|
|
|
|
switch($host_os) {
|
|
case RAR_HOST_MSDOS:
|
|
case RAR_HOST_OS2:
|
|
case RAR_HOST_WIN32:
|
|
case RAR_HOST_MACOS:
|
|
printf("%c%c%c%c%c%c\n",
|
|
($attr & 0x08) ? 'V' : '.',
|
|
($attr & 0x10) ? 'D' : '.',
|
|
($attr & 0x01) ? 'R' : '.',
|
|
($attr & 0x02) ? 'H' : '.',
|
|
($attr & 0x04) ? 'S' : '.',
|
|
($attr & 0x20) ? 'A' : '.');
|
|
break;
|
|
case RAR_HOST_UNIX:
|
|
case RAR_HOST_BEOS:
|
|
switch ($attr & 0xF000)
|
|
{
|
|
case 0x4000:
|
|
printf("d");
|
|
break;
|
|
case 0xA000:
|
|
printf("l");
|
|
break;
|
|
default:
|
|
printf("-");
|
|
break;
|
|
}
|
|
printf("%c%c%c%c%c%c%c%c%c\n",
|
|
($attr & 0x0100) ? 'r' : '-',
|
|
($attr & 0x0080) ? 'w' : '-',
|
|
($attr & 0x0040) ? (($attr & 0x0800) ? 's':'x'):(($attr & 0x0800) ? 'S':'-'),
|
|
($attr & 0x0020) ? 'r' : '-',
|
|
($attr & 0x0010) ? 'w' : '-',
|
|
($attr & 0x0008) ? (($attr & 0x0400) ? 's':'x'):(($attr & 0x0400) ? 'S':'-'),
|
|
($attr & 0x0004) ? 'r' : '-',
|
|
($attr & 0x0002) ? 'w' : '-',
|
|
($attr & 0x0001) ? 'x' : '-');
|
|
break;
|
|
}
|
|
|
|
rar_close($rar_file);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><xref linkend="function.rar-gethostos" /></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|