named pipe input
max2 at fisso.casa
Thu Sep 1 21:03:27 CEST 2005
i have some problems understanding following behaviour.
$ cat file_input_3.pl
open MIAPIPE, "una_pipe";
while ($riga = <MIAPIPE>)
print STDOUT ("$riga");
$ cat file_input_3.py
MIAPIPE = open("una_pipe", "r")
for riga in MIAPIPE:
where una_pipe is a named pipe (created with mkfifo).
when i run this on console #1:
and this un console #2:
$ cat > una_pipe
then each line typed in console #2 appears on console #1 as soon as the
line is terminated (hit return).
BUT if i try to do the same with the python code, something different
happens: i have to type ALL the lines on console #2 and complete the cat
command (ctrl-d) before seeing the lines echoed on console #1.
i tried the -u flag but doesnt seem to work.
More information about the Python-list