stdin - seek() issue on Linux.

Donn Cave donn at u.washington.edu
Tue Apr 23 12:24:22 EDT 2002


Quoth harisri at bigpond.com (Srihari Vijayaraghavan):
(quoting me)
|> Of course if the real program uses some filter, instead of "cat",
|> then there's no solution - you can't seek in a pipe, so the answer
|> has to be "don't do that".
|> 

| My mistake, I haven't given the complete context. The above mentioned
| method doesn't throw exceptions in Windows using the same Python
| version (neither does it print anything, which is the ultimate problem
| I would like to be solved).

That's too bad.  Something that doesn't/can't work should raise an
exception, in my opinion.  I don't know how Microsoft's stdin works,
but it must either fail all the time, or part of the time.  If they
allow it to pass without error because it occasionally may work,
that's appalling.

| Are there any better method of redirecting the stdout of a program to
| stdin of my program in both windows and linux? (specifically I should
| be able to seek() on it)

Write to a disk file, then run the second program.  Or if you can
store enough data in your program to satisfy your requirement,
then you can use a pipe.

	Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list