Re: [xml] xmlwriter, flush file buffer

On Thu, Mar 03, 2005 at 11:00:27AM +0100, Pierre Joye wrote:

I'm a bit confused with xmlTextWriterFlush (simple wrapper around

I expected it to flush the IO and not only to flush the buffer to the
IO. After a short review, it seems that xmlFileFlush should be called
as well. Actually the buffer is just pushed out, and no system flush
is done. xmlFileFlush being called only using the closecallback
(default callback).

Is it the expected behiavior?

The problem is basically the same as described here: gnome org/msg00140.html

My problem is that I have to mess up directly with the IO when using
the libxml IO implementation.

  You can't call directly xmlFileFlush() from xmlOutputBufferFlush()
you must use one of the I/O callbacks. And it does call out->writecallback()
there is no "flush" notion at that level of the I/O stack.
  xmlOutputBufferFlush() means the data in the buffers are written to the
I/O, if you want a synchronous write then you should use an I/O open in
that mode.
  Checking for out->closecallback == xmlFileFlush and calling it in that
case might be doable, but a close is not a flush semantically.


Daniel Veillard      | Red Hat Desktop team
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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