[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROG] [PHP] lidt filhåndtering



"tdn" <sslug@sslug> skrev den 22-Aug-02:

> function make_dummy_file($filename,$size,$data)
> {
>         if($size > filesize($filename))
>         {
>                 $fp = fopen($filename, "a+");
>                 while(filesize($filename) < $size)
>                 {
>                         fputs($fp, $data);
>                 }
>                 fclose($fp);
>         }
> }

Et hurtigt bud, helt uafprøvet:

function make_dummy_file($filename,$size,$data)
{
        $missing = ($size - filesize($filename)) / strlen($data);
        if($missing > 0)
        {
                $fp = fopen($filename, "a+");
                while($missing-- > 0)
                {
                        fputs($fp, $data);
                }
                fclose($fp);
        }
}





 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 19:58 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *