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 la posición de lectura/escritura del apuntador al archivo gz
Descripción
int gztell
( resource
$zp
)Obtiene la posición del apuntador al archivo dado; por ejemplo, su desplazamiento en el flujo del archivo sin comprimir.
Parámetros
-
zp -
El apuntador al archivo gz. Debe ser válido y debe apuntar a un archivo abierto exitosamente por gzopen().
Valores devueltos
La posición del apuntador al archivo o FALSE si ocurre un error.
Ver también
- gzopen() - Abre un archivo gz
- gzseek() - Ubica el apuntador a un archivo gz
- gzrewind() - Reinicia la posición del apuntador a un archivo gz
Steve Ramage ¶
6 years ago
