bzopen
(PHP 4 >= 4.0.4, PHP 5)
bzopen -- bzip2 압축 파일을 연다
설명
resource
bzopen ( string filename, string mode)
읽거나 쓰기 위해 bzip2 (.bz2) 파일을 연다.
filename은 열기위한 파일명이다.
mode는
fopen()(읽기용의 `r' , 쓰기용의 `w', 등등 )과
유사하다.
열기를 실패하면, 이 함수는 FALSE를 반환하고, 그렇지 않으면
새롭게 열린 파일의 포인터를 반환한다.
예 1. bzopen() 예제코드
<?php $bz = bzopen("/tmp/foo.bz2", "r");
$decompressed_file = ''; while (!feof($bz)) { $decompressed_file .= bzread($bz, 4096); } bzclose($bz);
print( "The contents of /tmp/foo.bz2 are: " ); print( "\n<br>\n" ); print( $decompressed_file ); ?>
|
|
bzclose() 참고.