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

search for in the

gzuncompress> <gzseek
Last updated: Sun, 25 Nov 2007

view this page in

gztell

(PHP 4, PHP 5)

gztell — 지정된 .gz 파일의 read/write position을 리턴한다

Description

int gztell ( int $zp )

zp 에의해 참조된 파일위치의 포인터를 반환한다; 즉, 파일스트림 내부의 offset

만일 에러가 발생하면 FALSE를 반환.

파일은 정확히 지정되어야 하고, gzopen()에의해 성공적으로 열린 파일이어야 한다.

참고 gzopen(), gzseek(), gzrewind().



add a note add a note User Contributed Notes
gztell
Steve Ramage
18-Dec-2006 10:09
ok so this function returns the gz file pointer as the uncompressed data byte length so if you are trying to put something in to specific size gzip files it won't work.

Example:

<?
//some_file.sql  filesize = 2,048,000 bytes

$text_fp=fopen('some_file.sql','r');
$gz_fp=gzopen('some_file.sql.gz','wb9');
while(!feof($text_fp)){
    gzwrite($gz_fp,fread($text_fp,655360));
}
fclose($text_fp);
echo "gztell = ".gztell($gz_fp)."<BR>\n";
gzclose($gz_fp);
echo "filesize = ".filesize('some_file.sql.gz')."<BR>\n";
?>

Output:

gztell = 2048000
filesize = 249264

I will report this as a bug but post a note here for now

gzuncompress> <gzseek
Last updated: Sun, 25 Nov 2007
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites