stdio EOF ?

Steve Holden sholden at holdenweb.com
Mon Aug 12 13:53:54 CEST 2002


"Joshua Schmidlkofer" <menion at asylumwear.com> wrote ...
>
> On Sun, 2002-08-11 at 14:39, Steve Holden wrote:
> > "Jacek Generowicz" <jacek.generowicz at cern.ch> wrote in message
> > news:tyfr8h883my.fsf at pcitapi22.cern.ch...
[...buffering problems?...]
> > >   cat command_file | filter.py | etc
> > >
> > > but in the "cat | filter.py" situation, it doesn't produce any output
> > > until C-d is sent.
> > >
> > > I guess I'm looking for a "while something(stdin)" or "while
> > > stdin.something" construct ...
> > >
> > > Any ideas ?
> > >
> >
> > Probably the most significant thing you can do is run the interpreter
with
> > the -u (unbuffered) option, to try to ensure that I/O transmission will
be
> > as immediate as possible. When you are feeding a pipeline it's often
> > difficult to ensure that the input to the downstream process is
delivered
> > exactly when you want it to be (because of buffering). Judicious use of
> > f.flush() can be helpful.
> >
> Perhaps someone should implement a suck() method for programs which are
> thwarted by being down stream of someone who doesn't know when to
> flush().
>

As in "this program suck()s"?

regards
-----------------------------------------------------------------------
Steve Holden                                 http://www.holdenweb.com/
Python Web Programming                http://pydish.holdenweb.com/pwp/
-----------------------------------------------------------------------








More information about the Python-list mailing list