Re: external file size, the bad way
| From: | Stig Sæther Bakken | Date: | Fri, 28 Jul 2000 06:50:46 +0000 |
| Subject: | Re: external file size, the bad way | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-26662@lists.php.net to get a copy of this message | ||
Stanislav Malyshev wrote:
>
> w>> I´ve found a solution. A crappy one....
> w>> Would be nice if someone had a better one...
> w>>
> w>>
> w>> while (!feof($fp)) { fread($fp,1); $i++; }
> w>> echo $i-1;
>
> Well, I think we need some function to get connection headers for the
> handle, which might contain file size too. I mean, when we use fopen
> wrappers it should store response headers in some sturcture, probably. Or
> we need set of libraries in PEAR that do it via sockets, like Perl's
> LWP. We might just take libwww from W3C and hook to it.
IMHO, it is dangerous to start attempting to fix everything in PEAR that
should really have been fixed in PHP. Mostly because when it is finally
fixed in PHP, you will get two ways to Rome, which is one of the things
we are dissing Perl about :-)
PHP_FILE now!
- Stig