Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: gztell - Manual
[go: Go Back, main page]

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

search for in the

gzuncompress" width="11" height="7"/> <gzseek
Last updated: Mon, 05 Feb 2007

view this page in

gztell

(PHP 4 <= 4.2.3)

gztell — gzファイルポインタの読み込み/書き込み位置を返します

説明

int gztell ( resource zp )

与えられたファイルポインタが指す位置、つまり、 ファイルストリームにおけるオフセット値を返します。

パラメータ

zp

gz ファイルポインタを指定します。これは有効なファイルポインタであり、 かつ、gzopen() によりオープンできたファイルを指している必要があります。

返り値

ファイルポインタの位置、もしくはエラーが発生した場合 FALSE

参考

gzopen()
gzseek()
gzrewind()



add a note add a note User Contributed Notes
gztell
Steve Ramage
19-Dec-2006 03: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" width="11" height="7"/> <gzseek
Last updated: Mon, 05 Feb 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites