:(
Its not working
$bytes = @readfile($filename);
if ($bytes === false){
//error-handling code
}
There is not any output ?
Richard Lynch wrote:
On Fri, October 14, 2005 6:29 am, Ruben Rubio Rey wrote:
if(file_exists($filename)){
$modified_date=filemtime($filename);
Richard Lynch wrote:
On Fri, October 14, 2005 6:29 am, Ruben Rubio Rey wrote:
if(file_exists($filename)){
$modified_date=filemtime($filename);
if(time()<($modified_date+1 * 24 * 60 * 60)){
$handle = fopen($filename, "r");
$contents = fread($handle, f
Ruben Rubio Rey wrote:
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
echo $contents;
Replace this with:
readfile($filename);
It's faster for both you and PHP.
Hope that helps.
Chris
--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http:
On Fri, October 14, 2005 6:29 am, Ruben Rubio Rey wrote:
>if(file_exists($filename)){
> $modified_date=filemtime($filename);
> if(time()<($modified_date+1 * 24 * 60 * 60)){
> $handle = fopen($filename, "r");
> $contents = fread($handle, filesize($file
On 14 Oct 2005, at 12:29, Ruben Rubio Rey wrote:
* For files less or equal 6 Kb, takes arround 0.02-0.03 miliseconds
- its ok
* For files arround 35 Kb takes arround 0.2-0.4 miliseconds - too
much.
Bearing in mind that average access time on a 7200rpm HD is around
8ms, those numbers sound
Ruben Rubio Rey wrote:
Hi,
I m creating a cache system, and i have a problem: PHP takes a lot of
time opening the file. (Im using 2.6.9-1.667smp and XFS)
* For files less or equal 6 Kb, takes arround 0.02-0.03 miliseconds -
its ok
* For files arround 35 Kb takes arround 0.2-0.4 miliseconds
Hi Ruben,
Friday, October 14, 2005, 12:29:09 PM, you wrote:
> What can I do to make faster opening files?
> **
> Source code:
>if(file_exists($filename)){
> $modified_date=filemtime($filename);
> if(time()<($modifi
Hi,
I m creating a cache system, and i have a problem: PHP takes a lot of
time opening the file. (Im using 2.6.9-1.667smp and XFS)
* For files less or equal 6 Kb, takes arround 0.02-0.03 miliseconds - its ok
* For files arround 35 Kb takes arround 0.2-0.4 miliseconds - too much.
What can I d
8 matches
Mail list logo