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
gztell
(PHP 4, PHP 5)
gztell — Indica a posição de leitura/gravação em um ponteiro para arquivo-gz
Descrição
int gztell
( resource $zp
)
Obtém a posição do ponteiro de arquivo; i.e., seu índice dentro do arquivo.
Parâmetros
- zp
-
O ponteiro de arquivo gz. Precisa ser válido, e deve apontar para um arquivo aberto corretamente com gzopen().
Valor Retornado
A posição do ponteiro do arquivo ou FALSE se um erro ocorrer.
Veja Também
- gzopen() - Abre um arquivo-gz
- gzseek() - Move o ponteiro de um arquivo-gz
- gzrewind() - Retorna ao início a posição de um ponteiro para um arquivo-gz
User Contributed Notes
gztell
gztell
Steve Ramage
18-Dec-2006 08:09
18-Dec-2006 08:09

gzseek