[Bioperl-l] flushing i/o with TreeIO

Jason Stajich jason@cgt.mc.duke.edu
Fri, 12 Jul 2002 00:18:44 -0400 (EDT)


On Thu, 11 Jul 2002, Aaron J Mackey wrote:

>
> Shouldn't we be flushing our filehandles after we finish with a
> write_seq??  Is there some reason not to?  It seems like not doing so just
> leads to this kind of odd, "behind the scenes" behavior ...
>
> -Aaron
>

Problem is that the writer is writing to a stream, we can't close it
because more might be written (repeated calls to write_seq/write_tree,
etc).  We can solve this by turning on autoflush, but there might be a
performance hit with autoflush (I'm guessing there is, that's why it is
turned off by default?) ?  Something to test and see.

I think that with any sort of filehandle the programmer is going to have
to take responsibility to call close on the handle when they are done
writing before reading data back in from the file.  But we should
include something in documentation for sure.

-jason

-- 
Jason Stajich
Duke University
jason at cgt.mc.duke.edu