RarArchive::close

(PECL rar >= 2.0.0)
Close RAR archive and free all resources
public bool RarArchive::close ( void )

Object oriented style (method):

Procedural style:

bool rar_close ( RarArchive $rarfile )

Close RAR archive and free all allocated resources.

Parameters:
rarfile

A RarArchive object, opened with rar_open().

Returns:

Returns TRUE on success or FALSE on failure.

Changelog:
2.0.0

The RAR entries returned by RarArchive::getEntry() and RarArchive::getEntries() are now invalidated when calling this method. This means that all instance methods called for such entries and not guaranteed to succeed.

Examples:
Object oriented style
<?php
$rar_arch = RarArchive::open('latest_winrar.rar');
echo $rar_arch."\n";
$rar_arch->close();
echo $rar_arch."\n";
?>

The above example will output something similar to:

RAR Archive "D:\php_rar\trunk\tests\latest_winrar.rar"
RAR Archive "D:\php_rar\trunk\tests\latest_winrar.rar" (closed)
Procedural style
<?php
$rar_arch = rar_open('latest_winrar.rar');
echo $rar_arch."\n";
rar_close($rar_arch);
echo $rar_arch."\n";
?>

doc_php
2016-02-24 15:55:32
Comments
Leave a Comment

Please login to continue.