[Tutor] named pipe problem

Kent Johnson kent37 at tds.net
Wed Aug 20 23:07:19 CEST 2008


On Wed, Aug 20, 2008 at 4:53 PM, Kent Johnson <kent37 at tds.net> wrote:

> See this informative thread:
> http://mail.python.org/pipermail/python-list/2006-August/396499.html
>
> Summary: opening a pipe for write blocks until it is also opened for read.

Also, on Mac OSX at least ordinary file operations seem to work fine.
For example, in one Terminal window:

$ mkfifo testf
$ cat < testf

In another Terminal window, start Python and type
In [5]: f=open('testf', 'w')
In [6]: f.write('foo\n')
In [7]: f.flush()
In [8]: f.close()

The output appears in the first window and the cat command finishes.
If do the Python part first, the open() blocks until I issue the cat
command.

Kent


More information about the Tutor mailing list