Linux pipes
Tasos Laskos
tasos.laskos at gmail.com
Wed Sep 24 12:53:29 EEST 2008
Christos Ricudis wrote:
> Tasos Laskos wrote:
>> Kalispera sti lista,
>>
>> Exo mia aporia/provlima me linux pipes.
>> Exo grapsei ena programma to opoio katevazei video kai to stelnei sto
>> stdin tou Kaffeine player.
>>
>> Px:
>> ----------------
>> vget --stdout http://www.veoh.com/videos/v6272417ktA6zTWy | kaffeine
>> stdin://
>> ----------------
>>
>> Exo paratirisei omos pos otan patao pause sto Kaffeine to programma
>> kanei episis pause.
>> Stamataei akoma kai na katevazei to video, vlepo apo network monitor
>> pos i taxitita peftei sto 0kBps.
>
> Opws mporeis poly eykola na fantasteis, o xwros proswrinhs apo8hkeyshs
> sthn pipa einai periorismenos (kai stis perissoteres periptwseis
> proka8orismenos), ara o dinwn thn pipa 8a prepei na stamathsei thn
> paragwgh mexri h lambanousa thn pipa process na mporesei na katapiei
> ta dedomena.
>
> Ayth h symperifora mporei na allaksei mono ean kaneis dikh sou
> endiamesh apo8hkeysh twn dedomenwn se kapoio buffer - bebaia gi ayto
> 8a prepei na grapseis kwdika, kai ta details einai ligo pipa. H logikh
> panw katw einai h ekshs :
>
> declare buffer[MAXLEN]
>
> while (not eof()) {
> if (write end of pipe is blocking) then {
> if (read end of pipe is not blocking and buffer is not full) {
> read data into buffer
> } else {
> block read end of pipe
> }
> if (write end of pipe is not blocking) then {
> if (buffer is not empty) {
> feed data from buffer into write end of pipe } else {
> block write end of pipe
> }
> }
> }
>
> To kalo m'ayth thn me8odo einai oti mporeis na pros8eseis meta polla
> diakosmhtika features apo ayta poy kanoyn thn pipa apolaysh, opws
> bandwitdh meter, bandwidth throttling, variable size buffering me
> jitter detection, ktl ktl ktl.
>
> An psakseis sto freshmeat gia "pipe", 8a breis kai merika ergaleia poy
> kanoun ayth th douleia.
>
>
Eyxaristo poly, ayto ksedialine kapos ta pragmata.
8a prepei na paikso me to kodika prin to ensomatoso sto vget giati
omologo pos eimai ligo mperdemenos.
To poly poly an de katafero na kano ayto pou 8elo 8a valo ena apo ta
ergaleia apo to freashmeat os dependency kai 8a xrisimopoieio ayto
anamesa sto vget kai ton ekastote player.
Eyxaristo ksana gia tin katalitiki kai synama anisixitiki[1] eksigisi. :)
[1] Toses "pipes" stis 10:31am einai kapos.... kapos. Mallon kapoios
ksypnise me kefakia simera :P
More information about the Linux-greek-users
mailing list