[Bioperl-l] flushing i/o with TreeIO
Lincoln Stein
lstein@cshl.org
Fri, 12 Jul 2002 09:58:08 -0400
If you use IO::Handle, this will give a flush() method that you can apply to
the filehandle. That way you can flush the filehandle without turning on
autoflush.
Lincoln
On Thursday 11 July 2002 06:26 pm, 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
>
> On Thu, 11 Jul 2002, Jason Stajich wrote:
> > You can do this by destructing the object -
> > $treeout = undef;
> > Since Bio::TreeIO objects are Bio::Root::IO objects you should be able to
> > close the filehandle by saying
> > $treeout->close();
> >
> > There is a way to turn autoflushing on by saying
> > $treeout->fh->autoflush(1) ;
> > but I think the above will work for you.
> >
> > HTH.
> >
> > > The only solution I have found is to return from the subroutine where
> > > the tree manipulation is happening.
> > >
> > > How do I flush output to file, or close the output file, to make it
> > > available for future reads, without having to exit the subroutine?
> > >
> > > Thanks,
> > > Howard
--
========================================================================
Lincoln D. Stein Cold Spring Harbor Laboratory
lstein@cshl.org Cold Spring Harbor, NY
========================================================================