Gunzip problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have txt file "text.txt" that contains:
	line1:one
	line2:two
	line3:three
	line4:

Line 4 contains empty string.

If I use f*() functions to read from the file:
	$handle=fopen("text.txt","r");
	while (!feof($handle)) echo("-".chop(fgets($handle))."-<BR>");
	fclose($handle);

the RESULT will be:
	-one-
	-two-
	-three-
	--

I gzipped the file using ZLIB functions.

If I use gz*() function to read from the gzip file:
	$handle=gzopen("text.txt.gz","r");
	while (!gzeof($handle)) echo("-".chop(gzgets($handle))."-<BR>");
	gzclose($handle);

the RESULT will be:
	-one-
	-two-
	-three-

SEE? The last (empty) line is not returned .

What am I doing wrong?

OKi98


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux