Bug #14976: gzopen URLs like fopen() does
| From: | epicanis+php at dogphilosophy dot net | Date: | Thu, 10 Jan 2002 20:06:19 +0000 |
| Subject: | Bug #14976: gzopen URLs like fopen() does | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-76529@lists.php.net to get a copy of this message | ||
From: epicanis+php@dogphilosophy.net
Operating system: ANY (Linux)http://slashdot.org/u
PHP version: 4.1.1
PHP Bug Type: Feature/Change Request
Bug description: gzopen URLs like fopen() does
One feature of PHP that I find REALLY handy is the
transparent handling of 'remote' files (i.e. http:// and
ftp:// URL's).
Currently gzopen "doesn't quite" handle anything but local
files. Attempting to gzopen, for example, an
"ftp://some.host.net/pub/somefile.gz" URL
currently
returns a strange error (the error itself reported as
Bug#14814).
I traced a gzopen("ftp://some.host.net/pub/somefile.gz")
sort of connection with ethereal, and noticed that
connection to the ftp server IS made, login is performed,
passive mode switched to, and the file is STARTED
downloading (about 3 1k packets came across) but the
script dies with a "Warning: Success in ...." error
message.
As I'm running the script from the command line as a
standalone utility, I can instead do something like :
wget -q ftp://some.host.net/pub/somefile.gz | php
gzfilething.php > gzoutput.txt
and gzopen("php://stdin") to process the text, and it does
work fine, but it's a bit awkward to use and is
inconsistent with fopen()'s behavior.
Note that the fopen with "zlib:" URL's doesn't work for
remote files, either (how would you write such a thing?
fopen("zlib:ftp://some.host.net/pub/somefile.gz","r")?
I
tried several variations and confirmed that zlib:
automatically assumes a local filehandle.
Thanks!
--
Edit bug report at: http://bugs.php.net/?id=14976&edit=1