From: Taylor Venable <taylor@metasyntax.net>
To: Pierre Chopin <pierre@punchup.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Problem with un-flushed output getting mangled
Date: Mon, 3 Oct 2011 21:39:58 -0400 [thread overview]
Message-ID: <CAAmKFxc2okJewUnvvSkn9ZTbmOR-Jg7P=HcSKginCPPBN91EuQ@mail.gmail.com> (raw)
In-Reply-To: <CAGyUfm1Tat6xRjmNhk7XQ8bNzP9BJpecbMK0fbSOoHY101aJHQ@mail.gmail.com>
On Mon, Oct 3, 2011 at 15:00, Pierre Chopin <pierre@punchup.com> wrote:
> 2011/9/29 Taylor Venable <taylor@metasyntax.net>
>>
>> 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/
prev parent reply other threads:[~2011-10-04 1:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-30 0:00 Taylor Venable
2011-09-30 9:45 ` Jerome Vouillon
2011-10-01 1:55 ` Taylor Venable
2011-10-01 7:11 ` Török Edwin
2011-10-03 10:51 ` Taylor Venable
2011-10-02 11:41 ` Tiphaine Turpin
[not found] ` <CAGyUfm24stnWFHwWGt4p0gZWA72FM97aXUZTe7wo1i9WDj7nFA@mail.gmail.com>
2011-10-03 19:00 ` Pierre Chopin
2011-10-04 1:39 ` Taylor Venable [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAAmKFxc2okJewUnvvSkn9ZTbmOR-Jg7P=HcSKginCPPBN91EuQ@mail.gmail.com' \
--to=taylor@metasyntax.net \
--cc=caml-list@inria.fr \
--cc=pierre@punchup.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox