CakeFest 2024: The Official CakePHP Conference

gztell

(PHP 4, PHP 5, PHP 7, PHP 8)

gztellGzipli dosya tanıtıcısının okuma/yazma konumunu döndürür

Açıklama

gztell(resource $dt): int|false

Belirtilen dosya tanıtıcısının, yani sıkıştırılmamış dosya akımının okuma/yazma konumunu döndürür.

Bağımsız Değişkenler

dt

Gzipli dosya tanıtıcısı. gzopen() tarafından açılmış bir dosyayı gösteren geçerli bir tanıtıcı olmalıdır.

Dönen Değerler

Dosya göstericisinin yeri veya bir hata oluşmuşsa false döner.

Ayrıca Bakınız

  • gzopen() - Bir gzipli dosya açar
  • gzseek() - Gzipli dosya göstericisini konumlar
  • gzrewind() - Gzipli dosya göstericisini dosya başlangıcına taşır

add a note

User Contributed Notes 1 note

up
0
Steve Ramage
17 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
To Top