in reply to Re^3: To organize pipe right way.
in thread To organize pipe right way.
I added the autoflush ahd its module -- still effect is the same. -- Repetings became necessary up to 7 instead up to 3 w/ the shell version.
I have no ideas what to do except to find the piece of code i have written long time ago for such a task -- that i remembere worked perfect. But do not know where the code is.
Here are the last changes:
use warnings; use strict; use utf8::all; use POSIX qw( mkfifo ); mkfifo( $svitok_truby, 0700 ) || die 'Ошиб
 +82;а создания & +#1090;рубы '.$svitok_truby.' : '.$!; local $SIG{CHLD} = "IGNORE"; # Родитель. if( $nomer_vosproizvodyshchego_protsessu=fork ){ use IO::Handle; open( $FIFO, '>'.$svitok_truby ) || die 'Не оm +0;крыть труб +091; '.$svitok_truby.' на запи +089;ь : '.$!; # Same thing? -- I.e. not working? $|=1; $FIFO->autoflush( 1 ); use Term::ReadKey; ReadMode 'cbreak'; while( 1 ){ $knopka=&ReadKey( 0 ); if( $knopka eq ' ' ){ print $FIFO 'pause'; }elsif( $knopka eq '0' ){ print $FIFO 'quit'; last; } } # Ребёнок. }else{ for( $i=0; $i<=$#svitok_na_vosproizvedenie; $i++ ){ system( '/usr/bin/mplayer -slave -input file='.$svitok_truby.' '.$ +svitok_na_vosproizvedenie_kom[$i] ); } } ReadMode 'normal'; close( FIFO ); unlink $svitok_truby;
Thanks for your answers.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: To organize pipe right way.
by kennethk (Abbot) on May 06, 2016 at 17:28 UTC | |
by nikolay (Beadle) on May 07, 2016 at 12:08 UTC | |
by nikolay (Beadle) on Jun 29, 2016 at 06:34 UTC |