in Deutsh
in French
in Polish

You Are At Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevNext

Rar::getAttr

(no version information, might be only in CVS)

Rar::getAttr -- Get attributes of the entry

Description

int Rar::getAttr ( void )

Rar::getAttr() returns attributes of the archive entry.

Example 1. Rar::getAttr() example

<?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);

?>

Rar::getAttr() returns FALSE on error.

See also Rar::getHostOs().

Najlepsza ochrona mienia na rynku
tłumaczenia
opakowania z nadrukiem
Najlepsza organizacja eventów Gorąco Polecamy!
Strony internetowe

Another Useful functions:


function.rar-getversion | function.rar-getunpackedsize | function.rar-getpackedsize | function.rar-getname | function.rar-getmethod | function.rar-gethostos | function.rar-getfiletime | function.rar-getcrc | function.rar-getattr |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.