Benchmark it both ways and see.
I benched this with a 100 MiB text file (largest I could find at short
notice). Buffer used for fread() calls was 2 KiB as above.
Values are averaged over 100 runs (I would have liked to do more, but I don't
have time). All values are to 4 significant figures
Richard Lynch wrote:
On Tue, August 23, 2005 12:48 am, Jasper Bryant-Greene wrote:
Kim Steinhaug (php list) wrote:
I'm using this method, works fine with 50mb+ files :
if( $fd = fopen ($filepath, 'r')){
while(!feof($fd)) {
$buffer = fread($fd, 2048);
print $buffer;
On Tue, August 23, 2005 12:48 am, Jasper Bryant-Greene wrote:
> Kim Steinhaug (php list) wrote:
>> I'm using this method, works fine with 50mb+ files :
>>
>> if( $fd = fopen ($filepath, 'r')){
>> while(!feof($fd)) {
>> $buffer = fread($fd, 2048);
>> print $buffer;
>>
Kim Steinhaug (php list) wrote:
I'm using this method, works fine with 50mb+ files :
if( $fd = fopen ($filepath, 'r')){
while(!feof($fd)) {
$buffer = fread($fd, 2048);
print $buffer;
}
fclose ($fd);
exit;
}
Is there a reason why you assign the
- Original Message -
From: "Evert | Rooftop" <[EMAIL PROTECTED]>
To: "PHP-Users"
Sent: Monday, August 22, 2005 9:30 PM
Subject: [PHP] Files passing through
> Hi People,
>
> I want to use a PHP script to pass through a file to the browser [ right
&g
On Mon, August 22, 2005 12:30 pm, Evert | Rooftop wrote:
> I want to use a PHP script to pass through a file to the browser [
> right
> after some processing ].
> What is the fastest way to do this? I know
> echo(file_get_contents('myfile')); is not a good idea ;)
Actually, it's a Fine Idea *IF* t
Kevin Waterson wrote:
This one time, at band camp, Philip Hallstrom <[EMAIL PROTECTED]> wrote:
My guess would be because file_get_contents returns the contents as a
string. So if 'myfile' is 100mb, you're going to have to allocate 100mb
of memory to store that string while echo() spits it ba
This one time, at band camp, Philip Hallstrom <[EMAIL PROTECTED]> wrote:
> My guess would be because file_get_contents returns the contents as a
> string. So if 'myfile' is 100mb, you're going to have to allocate 100mb
> of memory to store that string while echo() spits it back out.
>
> But I'
What is the fastest way to do this? I know
echo(file_get_contents('myfile')); is not a good idea ;)
Why not?
My guess would be because file_get_contents returns the contents as a
string. So if 'myfile' is 100mb, you're going to have to allocate 100mb
of memory to store that string while ech
This one time, at band camp, Evert | Rooftop <[EMAIL PROTECTED]> wrote:
> What is the fastest way to do this? I know
> echo(file_get_contents('myfile')); is not a good idea ;)
Why not?
Kevin
--
"Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb
Hi People,
I want to use a PHP script to pass through a file to the browser [ right
after some processing ].
What is the fastest way to do this? I know
echo(file_get_contents('myfile')); is not a good idea ;)
Is fpassthrough the right choice?
maybe virtual, so it won't go through php but apac
11 matches
Mail list logo