Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

rar getattr function syntax tag tutorial 2013 Donate at flattr Flattr this





Alert! Connect with 10,000 Chating Online. Join Now

Php rar getattr () function

Write your php code

 
<?php ?>

Php Result


Your code below



(no version information, might be only in CVS)

Rar::getAttr -- Get attributes of the entry

Syntax

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().

Php rar getattr Function syntax tag

rar getattr php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php rar getattr syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online