RarArchive::setAllowBroken

(PECL rar >= 3.0.0)

RarArchive::setAllowBrokenWhether opening broken archives is allowed

Beschreibung

Objektorientierter Stil (method):

public RarArchive::setAllowBroken(bool $allow_broken): bool

Prozeduraler Stil:

rar_allow_broken_set(RarArchive $rarfile, bool $allow_broken): bool

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.

Parameter-Liste

rarfile

A RarArchive object, opened with rar_open().

allow_broken

Whether to allow reading broken files (true) or not (false).

Rückgabewerte

Returns true Bei einem Fehler wird false zurückgegeben.. It will only fail if the file has already been closed.

Beispiele

Beispiel #1 Objektorientierter Stil

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

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

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

Beispiel #2 Prozeduraler Stil

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

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Große JSON-Dateien in PHP effizient streamen?

Ja, das geht – am besten mit einem Streaming-Parser wie json-machine oder salsify/json-streaming-parser. Damit liest du die Datei Stück für St ...

Geschrieben von cherybomb am 12.01.2026 10:01:04
Forum: PHP Developer Forum
Sometimes You Just Need to Explode Something: A Deep Dive into Kick the Buddy

We all have those days. Maybe your coffee spilled on your favorite shirt, maybe a deadline is looming over your head like a dark cloud, or maybe y ...

Geschrieben von Bradleyerr am 12.01.2026 03:53:34
Forum: Ankündigungen
übergabeproblem

Proper debugging You notice that a script is not doing what it is supposed to. The following line is written at the beginning of the script: er ...

Geschrieben von JohnSnow am 10.01.2026 15:58:16
Forum: PHP Developer Forum
Helldivers 2 Major Orders Explained: A Guide to Community Goals

Major Orders are the large-scale, community-wide objectives that drive the Galactic War in Helldivers 2. If you've ever wondered why everyone seem ...

Geschrieben von PixelNova am 10.01.2026 04:11:48
Forum: Off-Topic Diskussionen