IT. Expert System.

PHP

Whether opening broken archives is allowed


RarArchive::setAllowBroken

(PECL rar >= 3.0.0)

RarArchive::setAllowBrokenWhether opening broken archives is allowed

Description

Object oriented style (method):

public bool RarArchive::setAllowBroken ( bool $allow_broken )

Procedural style:

bool rar_allow_broken_set ( RarArchive $rarfile , bool $allow_broken )

This method defines whether broken archives can be read or all the operations that attempt to extract the archive entries will fail. Broken archives are archives for which no error is detected when the file is opened but an error occurs when reading the entries.

Parameters

rarfile

A RarArchive object, opened with rar_open().

allow_broken

Whether to allow reading broken files (TRUE) or not (FALSE).

Return Values

Returns TRUE or FALSE on failure. It will only fail if the file has already been closed.

Examples

Example #1 Object oriented style

<?php
function retnull() { return null; }
$file dirname(__FILE__) . "/multi_broken.part1.rar";
/* Third argument omits "volume not found" message */
$a RarArchive::open($filenull'retnull');
$a->setAllowBroken(true);
foreach (
$a->getEntries() as $e) {
    echo 
"$e\n";
}
var_dump(count($a));
?>

The above example will output something similar to:

 RarEntry for file "file1.txt" (52b28202) int(1) 

Example #2 Procedural style

<?php
function retnull() { return null; }
$file dirname(__FILE__) . "/multi_broken.part1.rar";
/* Third argument omits "volume not found" message */
$a rar_open($filenull'retnull');
rar_allow_broken_set($atrue);
foreach (
rar_list($a) as $e) {
    echo 
"$e\n";
}
var_dump(count($a));
?>

See Also



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 62 / 158748774. Delta: 0.00444 с