|
Posted by Ben Morrow on June 10, 2008, 1:39 pm
Please log in for more thread options
>
> > >
> > > 5.23: All I want to do is append a small amount of text to the end of a
> > > file. Do I still have to use locking?
> > >
> > <snip>
> > > There is still a small theoretical chance that a signal will interrupt
> > > the system level write() operation before completion. There is also a
> > > possibility that some STDIO implementations may call multiple system
> > > level write()s even if the buffer was empty to start. There may be some
> > > systems where this probability is reduced to zero.
> >
> > This includes all systems using the :perlio layer instead of native
> > STDIO.
>
> Do you mean that :perlio is one of the systems where the probability is
> zero for calling multiple system level writes() even if the buffer is
> empty?
Yes. :perlio only flushes when the buffer is full (in full-buffered
mode).
> I don't know much about the internals. I'm not sure how to adjust the
> answer.
Perhaps
where this probability is reduced to zero, and this is not a concern
when using :perlio instead of your system's STDIO.
?
Ben
--
And if you wanna make sense / Whatcha looking at me for? (Fiona Apple)
* ben@morrow.me.uk *
|