Re: [PHP3] fopen using append not atomic.
| From: | Christine Burke | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: [PHP3] fopen using append not atomic. | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-4483@lists.php.net to get a copy of this message | ||
> >Ah, right. atomicity is only guaranteed for unbuffered file operations.
> >I completely forgot about that. We will have to have a look at the best
> >way to provide unbuffered io ops in PHP.
> >
> >-Rasmus
>
> Richard and I played with this some. Basically a call like (C code):
>
> setvbuf( fp, NULL, _IONBF, 0 );
>
> needs to be made on the file pointer immediately after the file is opened.
> Now I do not know whether this should be wrapped up somehow, or simply
> expose setvbuf through PHP. What is the preferred way of doing this?
Well, we don't want to kick all file ops into unbuffered mode by default.
So, we either add an optional flag to fopen() or we provide a setvbuf()
function (although we might want to call it something more sane).
-Rasmus
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net