note 95130 added to function.gzseek

From: Date: Tue, 15 Dec 2009 00:06:15 +0000
Subject: note 95130 added to function.gzseek
Groups: php.notes 
Request: Send a blank email to php-notes+get-163971@lists.php.net to get a copy of this message
The function provided by dperham adds an extra byte to the total uncompressed length. On large files located on NFS mounts tends to be slow as it's doing multiple seeks to find the end of the file. The following can be used to report the compressed size of the file correctly: <?php $file = '/u/scottr/qa/testfile.bin.gz'; $fp = fopen($file, 'rb'); fseek($fp, -4, SEEK_END); $buf = fread($fp, 4); $file_size = end(unpack("V", $buf)); fclose($fp); print $file_size; ?> ---- Server IP: 64.71.164.2 Probable Submitter: 69.134.56.36 ---- Manual Page -- http://www.php.net/manual/en/function.gzseek.php Edit -- https://master.php.net/note/edit/95130 Del: integrated -- https://master.php.net/note/delete/95130/integrated Del: useless -- https://master.php.net/note/delete/95130/useless Del: bad code -- https://master.php.net/note/delete/95130/bad+code Del: spam -- https://master.php.net/note/delete/95130/spam Del: non-english -- https://master.php.net/note/delete/95130/non-english Del: in docs -- https://master.php.net/note/delete/95130/in+docs Del: other reasons-- https://master.php.net/note/delete/95130 Reject -- https://master.php.net/note/reject/95130 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#163971) next »