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

search for in the

gzuncompress> <gzseek
[edit] Last updated: Fri, 24 May 2013

view this page in

gztell

(PHP 4, PHP 5)

gztellLit la position courante du pointeur de lecture

Description

int gztell ( resource $zp )

gztell() retourne la position du pointeur de lecture dans le fichier zp.

Liste de paramètres

zp

Le pointeur de fichier. Il doit être valide et doit pointer vers un fichier ouvert avec succès grâce à la fonction gzopen().

Valeurs de retour

La position du pointeur de fichier ou FALSE si une erreur survient.

Voir aussi

  • gzopen() - Ouvre un fichier compressé avec gzip
  • gzseek() - Déplace le pointeur de lecture
  • gzrewind() - Replace le pointeur au début du fichier



add a note add a note User Contributed Notes gztell - [1 notes]
up
0
Steve Ramage
6 years ago
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

 
show source | credits | stats | sitemap | contact | advertising | mirror sites