2009/7/20 Martin Zvarík <mzva...@gmail.com>:

>> 2009/7/20 Martin Zvarík <mzva...@gmail.com>:
>>> <?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

Reply via email to