PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

bzwrite> <bzopen
Last updated: Fri, 22 Aug 2008

view this page in

bzread

(PHP 4 >= 4.3.3, PHP 5, PECL bz2:1.0)

bzreadLectura segura de archivo bzip2 binario

Descripción

string bzread ( resource $bz [, int $longitud ] )

bzread() lee del apuntador de archivo bzip2 dado.

La lectura se detiene cuando longitud (de datos sin comprimir) es alcanzada o se encuentra el fin de archivo (EOF), lo que ocurra primero.

Lista de parámetros

bz

El apuntador del archivo. Este debe ser válido y debe apuntar a un archivo abierto exitosamente por bzopen().

longitud

Si no se específica, bzread() leerá 1024 bytes (sin comprimir) a la vez.

Valores retornados

Regresa los datos ya sin compresión, o FALSE en caso de error.

Ejemplos

Example #1 Ejemplo de bzread()

<?php

$file 
"/tmp/foo.bz2";
$bz bzopen($file"r") or die("Couldn't open $file");

$decompressed_file '';
while (!
feof($bz)) {
    
$decompressed_file .= bzread($bz4096);
}
bzclose($bz);

echo 
"The contents of $file are: <br />\n";
echo 
$decompressed_file;

?>

Ver también



add a note add a note User Contributed Notes
bzread
bitlz at mail dot ru
05-Aug-2004 07:02
max value of length is 8192 (2^13).
if length is more than 8192 bzread understand as 8192. :)

ps. php 5.0.0 under win2k sp4.

bzwrite> <bzopen
Last updated: Fri, 22 Aug 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites