On Mon, Oct 3, 2011 at 15:00, Pierre Chopin <[email protected]> wrote:
> 2011/9/29 Taylor Venable <[email protected]>
>>
>> Hi there, I'm having a problem with some code I've written. The gist
>> of my program (whose code I unfortunately cannot share at this time,
>> I'll have to get approval first) is this:
>>
>> 1. Read elements from an XML file and turn them into objects.
>> 2. Place these objects into hash tables.
>> 3. Do some stuff with those objects.
>> 4. Print them out to various files (depending on the type of the object).
>>
>> My trouble is this: if I fail to call flush on the output channels in
>> step #4, I get mangled output.
>
> Do you have more than one output channel on the same file open at the same
> time ?

I looked, and sure enough there was some old code that was writing the
same file earlier in the program's execution, and it never closed the
channel when it was done. Removing that other code fixed the problem.
So even though the writing was never interleaved, I presume the
buffering of the two channels interfered with each other and caused
the problems I was seeing in the output. Thank you!

-- 
Taylor C. Venable
http://metasyntax.net/

-- 
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to