超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<bzflushbzread>
Last updated: Fri, 22 Jun 2007

bzopen

(PHP 4 >= 4.0.4, PHP 5)

bzopen -- Opens a bzip2 compressed file

Description

resource bzopen ( string filename, string mode)

bzopen() opens a bzip2 (.bz2) file for reading or writing. filename is the name of the file to open. mode is similar to the fopen() function (`r' for read, `w' for write, etc.).

If the open fails, bzopen() returns FALSE, otherwise it returns a pointer to the newly opened file.

例子 1. bzopen() example

<?php

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

bzclose($bz);

?>

See also bzclose().




add a note add a note User Contributed Notes
bzopen
cluebie
25-May-2002 07:19
Note that the provided example seems to contradict the manual entry for bzread().  

The number of bytes read is the number of uncompressed bytes, according to bzread().  Since the filesize is likely to be much smaller than the actual uncompressed size the provided example will not print out the total contents of the file.

<bzflushbzread>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22