Re: Re: file_set_contents() do several times?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/7/20 Martin Zvarík <mzvarik@xxxxxxxxx>:

>> 2009/7/20 Martin Zvarík <mzvarik@xxxxxxxxx>:
>>> <?php
>>> $i = 0;
>>> do {
>>>   $i++;
>>>   $r = file_put_contents('file.txt', 'content');
>>> } while($r === false && $i < 3);
>>>
>>> if ($r === false) die('error');
>>>
>>> ?>
>>>

> I am not appending anything, just ensuring that it will be written (and
> giving it max. 3 tryes).

Ok, don't do that. If it didn't work the first time, it won't work
0.001 seconds later, either. Chances are it will either be a
permissions error, or out-of-disc-space.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux