Hi, the great!
I got a problem w/ the pipes that is concluded in necessity to repeat data, sent into pipe in order to achieve the desired action.
In my script i have two parts -- a parent and a child. A parent sends signals to pipe, that are recieved by a process, run by the child -- i.e. pipe is used not between the parent and child, but between parent and another process, that the child creates (the process is the mplayer2).
So, when the parent sends signals (the key pressed by a user) to pipe (to the mplayer2), the mplayer2 not always receives it -- so that the users has to repeat h(is/er) pressings. -- And this is the problem that i want to solve -- to remove the repeatings.
Here is the code (relevant pieces only).
use POSIX qw( mkfifo ); mkfifo( $svitok_truby, 0700 ) || die $svitok_truby.' : '.$!; if( $nomer_vosproizvodyshchego_protsessu=fork ){ # forces a flush right away and after every write or print on the +currently selected output channel. $|=1; system( '/bin/echo \'seek -10\' >'.$svitok_truby ); }else{ system( '/usr/bin/mplayer -slave -input file='.$svitok_truby.' /tm +p/1.flac' ); }
Thank you for help!
In reply to To organize pipe right way. by nikolay
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |