ID: 14814 Updated by: georg Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Zlib Related Operating System: Linux (2.4.17) PHP Version: 4.1.1 New Comment:
For opening zip-files via ftp or httpd, there is a little note in the manual: Note: The current CVS version 4.0.4-dev introduces a fopen-wrapper for .gz-files, so that you can use a special 'zlib:' URL to access compressed files transparently using the normal f*() file access functions if you prepend the filename or path with a 'zlib:' prefix when calling fopen(). This feature requires a C runtime library that provides the fopencookie() function. To my current knowledge the GNU libc is the only library that provides this feature. But for sure, this is not a solution for the errormessage :-) Previous Comments: ------------------------------------------------------------------------ [2002-01-02 20:37:21] [EMAIL PROTECTED] It's not clear from the manual whether or not gzopen is SUPPOSED to work with http:// and ftp:// URL's, but I get the impression the answer is "not yet". (The documentation in the manual IMPLIES that it the filehandle-like functions should work with the exception of socket functions, but the user commentary below the gzopen entry implies that it doesn't work for http:// URL's either...) However, when attempting to gzopen a .gz file from an FTP site, the error message returned is very strange: ----------------------------------------------------- <b>Warning</b>: gzopen("ftp://ftp.ncbi.nih.gov/genbank/gbpln3.seq.gz","r") - Success in <b>projects/phpdna/get28s.php</b> on line <b>69</b><br> Like, dude! Couldn't gzopen ftp://ftp.ncbi.nih.gov/genbank/gbpln3.seq.gz! The gzopen returned ----------------------------------------------------- ("Warning - Success?????") (the section of code that does this is: ----------------------------------------------------- if(!($fhandle=gzopen($filename,"r"))) { print("Like, dude! Couldn't gzopen $filename!\n"); print("The gzopen returned $fhandle\n"); } ----------------------------------------------------- where filename has obviously been passed as ftp://ftp.ncbi.nih.gov/genbank/gbpln3.seq.gz There's a pause that implies the connection attempt is being made. (quick update, I just re-ran the script and did a capture with 'ethereal' - a connection IS being made and, passive mode is being switched to, and the RETR is started on the file, and about 3 1K packets seem to come across. Are FTP URL's supposed to work? Is this a 'gzopen ftp://' bug rather than an error message bug?) I'll report the "Please Oh Please add http/ftp URL support to gzopen like fopen has!" separately as a feature request later, presuming it doesn't turn out that it's already been done and I just don't know what I'm doing... Thanks! ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=14814&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]